Search in sources :

Example 6 with VmConfigInfo

use of com.vmware.vim25.VmConfigInfo in project cloudstack by apache.

the class VmwareResource method setDeployAsIsProperties.

/**
 * Set OVF properties (if available)
 */
private void setDeployAsIsProperties(VirtualMachineMO vmMo, DeployAsIsInfoTO deployAsIsInfo, VirtualMachineConfigSpec vmConfigSpec, VmwareHypervisorHost hyperHost) throws Exception {
    if (deployAsIsInfo != null && MapUtils.isNotEmpty(deployAsIsInfo.getProperties())) {
        Map<String, String> properties = deployAsIsInfo.getProperties();
        VmConfigInfo vAppConfig = vmMo.getConfigInfo().getVAppConfig();
        s_logger.info("Copying OVF properties to the values the user provided");
        setVAppPropertiesToConfigSpec(vAppConfig, properties, vmConfigSpec, hyperHost);
    }
}
Also used : VmConfigInfo(com.vmware.vim25.VmConfigInfo)

Example 7 with VmConfigInfo

use of com.vmware.vim25.VmConfigInfo in project cloudstack by apache.

the class VmwareResource method copyVAppConfigOvfSectionFromOVF.

/**
 * Set the ovf section spec from existing vApp configuration
 */
protected List<VAppOvfSectionSpec> copyVAppConfigOvfSectionFromOVF(VmConfigInfo vAppConfig, boolean useEdit) {
    List<VAppOvfSectionInfo> ovfSection = vAppConfig.getOvfSection();
    List<VAppOvfSectionSpec> specs = new ArrayList<>();
    for (VAppOvfSectionInfo info : ovfSection) {
        VAppOvfSectionSpec spec = new VAppOvfSectionSpec();
        spec.setInfo(info);
        spec.setOperation(useEdit ? ArrayUpdateOperation.EDIT : ArrayUpdateOperation.ADD);
        specs.add(spec);
    }
    return specs;
}
Also used : VAppOvfSectionSpec(com.vmware.vim25.VAppOvfSectionSpec) VAppOvfSectionInfo(com.vmware.vim25.VAppOvfSectionInfo) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)3 VmConfigInfo (com.vmware.vim25.VmConfigInfo)2 VirtualMachineMO (com.cloud.hypervisor.vmware.mo.VirtualMachineMO)1 OVAProcessor (com.cloud.storage.template.OVAProcessor)1 Pair (com.cloud.utils.Pair)1 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)1 Script (com.cloud.utils.script.Script)1 VAppOvfSectionInfo (com.vmware.vim25.VAppOvfSectionInfo)1 VAppOvfSectionSpec (com.vmware.vim25.VAppOvfSectionSpec)1 VAppProductInfo (com.vmware.vim25.VAppProductInfo)1 VAppProductSpec (com.vmware.vim25.VAppProductSpec)1 VAppPropertyInfo (com.vmware.vim25.VAppPropertyInfo)1 VAppPropertySpec (com.vmware.vim25.VAppPropertySpec)1 VStorageObject (com.vmware.vim25.VStorageObject)1 VirtualDevice (com.vmware.vim25.VirtualDevice)1 VirtualDeviceConfigSpec (com.vmware.vim25.VirtualDeviceConfigSpec)1 VirtualMachineConfigInfo (com.vmware.vim25.VirtualMachineConfigInfo)1 VirtualMachineConfigSpec (com.vmware.vim25.VirtualMachineConfigSpec)1 VmConfigSpec (com.vmware.vim25.VmConfigSpec)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1