|
37 | 37 | import org.apache.cloudstack.api.response.VmwareDatacenterResponse;
|
38 | 38 | import org.apache.cloudstack.api.response.ZoneResponse;
|
39 | 39 | import org.apache.cloudstack.vm.VmImportService;
|
| 40 | +import org.apache.commons.lang3.BooleanUtils; |
40 | 41 | import org.apache.commons.lang3.ObjectUtils;
|
41 | 42 | import org.apache.commons.lang3.StringUtils;
|
42 | 43 |
|
@@ -116,40 +117,44 @@ public class ImportVmCmd extends ImportUnmanagedInstanceCmd {
|
116 | 117 | description = "Temp Path on external host for disk image copy" )
|
117 | 118 | private String tmpPath;
|
118 | 119 |
|
119 |
| - // Import from Vmware to KVM migration parameters |
| 120 | + // Import from VMware to KVM migration parameters |
120 | 121 |
|
121 | 122 | @Parameter(name = ApiConstants.EXISTING_VCENTER_ID,
|
122 | 123 | type = CommandType.UUID,
|
123 | 124 | entityType = VmwareDatacenterResponse.class,
|
124 |
| - description = "(only for importing migrated VMs from Vmware to KVM) UUID of a linked existing vCenter") |
| 125 | + description = "(only for importing VMs from VMware to KVM) UUID of a linked existing vCenter") |
125 | 126 | private Long existingVcenterId;
|
126 | 127 |
|
127 | 128 | @Parameter(name = ApiConstants.HOST_IP,
|
128 | 129 | type = BaseCmd.CommandType.STRING,
|
129 |
| - description = "(only for importing migrated VMs from Vmware to KVM) VMware ESXi host IP/Name.") |
| 130 | + description = "(only for importing VMs from VMware to KVM) VMware ESXi host IP/Name.") |
130 | 131 | private String hostip;
|
131 | 132 |
|
132 | 133 | @Parameter(name = ApiConstants.VCENTER,
|
133 | 134 | type = CommandType.STRING,
|
134 |
| - description = "(only for importing migrated VMs from Vmware to KVM) The name/ip of vCenter. Make sure it is IP address or full qualified domain name for host running vCenter server.") |
| 135 | + description = "(only for importing VMs from VMware to KVM) The name/ip of vCenter. Make sure it is IP address or full qualified domain name for host running vCenter server.") |
135 | 136 | private String vcenter;
|
136 | 137 |
|
137 | 138 | @Parameter(name = ApiConstants.DATACENTER_NAME, type = CommandType.STRING,
|
138 |
| - description = "(only for importing migrated VMs from Vmware to KVM) Name of VMware datacenter.") |
| 139 | + description = "(only for importing VMs from VMware to KVM) Name of VMware datacenter.") |
139 | 140 | private String datacenterName;
|
140 | 141 |
|
141 | 142 | @Parameter(name = ApiConstants.CLUSTER_NAME, type = CommandType.STRING,
|
142 |
| - description = "(only for importing migrated VMs from Vmware to KVM) Name of VMware cluster.") |
| 143 | + description = "(only for importing VMs from VMware to KVM) Name of VMware cluster.") |
143 | 144 | private String clusterName;
|
144 | 145 |
|
145 | 146 | @Parameter(name = ApiConstants.CONVERT_INSTANCE_HOST_ID, type = CommandType.UUID, entityType = HostResponse.class,
|
146 |
| - description = "(only for importing migrated VMs from Vmware to KVM) optional - the host to perform the virt-v2v migration from VMware to KVM.") |
| 147 | + description = "(only for importing VMs from VMware to KVM) optional - the host to perform the virt-v2v migration from VMware to KVM.") |
147 | 148 | private Long convertInstanceHostId;
|
148 | 149 |
|
149 | 150 | @Parameter(name = ApiConstants.CONVERT_INSTANCE_STORAGE_POOL_ID, type = CommandType.UUID, entityType = StoragePoolResponse.class,
|
150 |
| - description = "(only for importing migrated VMs from Vmware to KVM) optional - the temporary storage pool to perform the virt-v2v migration from VMware to KVM.") |
| 151 | + description = "(only for importing VMs from VMware to KVM) optional - the temporary storage pool to perform the virt-v2v migration from VMware to KVM.") |
151 | 152 | private Long convertStoragePoolId;
|
152 | 153 |
|
| 154 | + @Parameter(name = ApiConstants.FORCE_MS_TO_IMPORT_VM_FILES, type = CommandType.BOOLEAN, |
| 155 | + description = "(only for importing VMs from VMware to KVM) optional - if true, forces MS to import VM file(s) to temporary storage, else uses KVM Host if ovftool is available, falls back to MS if not.") |
| 156 | + private Boolean forceMsToImportVmFiles; |
| 157 | + |
153 | 158 | /////////////////////////////////////////////////////
|
154 | 159 | /////////////////// Accessors ///////////////////////
|
155 | 160 | /////////////////////////////////////////////////////
|
@@ -198,6 +203,10 @@ public Long getConvertStoragePoolId() {
|
198 | 203 | return convertStoragePoolId;
|
199 | 204 | }
|
200 | 205 |
|
| 206 | + public Boolean getForceMsToImportVmFiles() { |
| 207 | + return BooleanUtils.toBooleanDefaultIfNull(forceMsToImportVmFiles, false); |
| 208 | + } |
| 209 | + |
201 | 210 | public String getHypervisor() {
|
202 | 211 | return hypervisor;
|
203 | 212 | }
|
|
0 commit comments