Skip to content

Commit 436d0bf

Browse files
committed
Merge branch 'main' into feature-kms
2 parents b58c46c + e2c13da commit 436d0bf

118 files changed

Lines changed: 4318 additions & 1467 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

agent/conf/agent.properties

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,3 +460,15 @@ iscsi.session.cleanup.enabled=false
460460

461461
# Time, in seconds, to wait before retrying to rebase during the incremental snapshot process.
462462
# incremental.snapshot.retry.rebase.wait=60
463+
464+
# Path to the VDDK library directory for VMware to KVM conversion via VDDK,
465+
# passed to virt-v2v as -io vddk-libdir=<path>
466+
#vddk.lib.dir=
467+
468+
# Ordered VDDK transport preference for VMware to KVM conversion via VDDK, passed as
469+
# -io vddk-transports=<value> to virt-v2v. Example: nbd:nbdssl
470+
#vddk.transports=
471+
472+
# Optional vCenter SHA1 thumbprint for VMware to KVM conversion via VDDK, passed as
473+
# -io vddk-thumbprint=<value>. If unset, CloudStack computes it on the KVM host via openssl.
474+
#vddk.thumbprint=

agent/src/main/java/com/cloud/agent/properties/AgentProperties.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,30 @@ public Property<Integer> getWorkers() {
808808
*/
809809
public static final Property<String> CONVERT_ENV_VIRTV2V_TMPDIR = new Property<>("convert.instance.env.virtv2v.tmpdir", null, String.class);
810810

811+
/**
812+
* Path to the VDDK library directory on the KVM conversion host, used when converting VMs from VMware to KVM via VDDK.
813+
* This directory is passed to virt-v2v as <code>-io vddk-libdir=&lt;path&gt;</code>.
814+
* Data type: String.<br>
815+
* Default value: <code>null</code>
816+
*/
817+
public static final Property<String> VDDK_LIB_DIR = new Property<>("vddk.lib.dir", null, String.class);
818+
819+
/**
820+
* Ordered list of VDDK transports for virt-v2v, passed as <code>-io vddk-transports=&lt;value&gt;</code>.
821+
* Example: <code>nbd:nbdssl</code>.
822+
* Data type: String.<br>
823+
* Default value: <code>null</code>
824+
*/
825+
public static final Property<String> VDDK_TRANSPORTS = new Property<>("vddk.transports", null, String.class);
826+
827+
/**
828+
* vCenter TLS certificate thumbprint used by virt-v2v VDDK mode, passed as <code>-io vddk-thumbprint=&lt;value&gt;</code>.
829+
* If unset, the KVM host computes it at runtime from the vCenter endpoint.
830+
* Data type: String.<br>
831+
* Default value: <code>null</code>
832+
*/
833+
public static final Property<String> VDDK_THUMBPRINT = new Property<>("vddk.thumbprint", null, String.class);
834+
811835
/**
812836
* BGP controll CIDR
813837
* Data type: String.<br>

api/src/main/java/com/cloud/agent/api/to/RemoteInstanceTO.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,17 @@ public class RemoteInstanceTO implements Serializable {
3636
private String vcenterPassword;
3737
private String vcenterHost;
3838
private String datacenterName;
39+
private String clusterName;
40+
private String hostName;
3941

4042
public RemoteInstanceTO() {
4143
}
4244

43-
public RemoteInstanceTO(String instanceName) {
45+
public RemoteInstanceTO(String instanceName, String clusterName, String hostName) {
4446
this.hypervisorType = Hypervisor.HypervisorType.VMware;
4547
this.instanceName = instanceName;
48+
this.clusterName = clusterName;
49+
this.hostName = hostName;
4650
}
4751

4852
public RemoteInstanceTO(String instanceName, String instancePath, String vcenterHost, String vcenterUsername, String vcenterPassword, String datacenterName) {
@@ -55,6 +59,12 @@ public RemoteInstanceTO(String instanceName, String instancePath, String vcenter
5559
this.datacenterName = datacenterName;
5660
}
5761

62+
public RemoteInstanceTO(String instanceName, String instancePath, String vcenterHost, String vcenterUsername, String vcenterPassword, String datacenterName, String clusterName, String hostName) {
63+
this(instanceName, instancePath, vcenterHost, vcenterUsername, vcenterPassword, datacenterName);
64+
this.clusterName = clusterName;
65+
this.hostName = hostName;
66+
}
67+
5868
public Hypervisor.HypervisorType getHypervisorType() {
5969
return this.hypervisorType;
6070
}
@@ -82,4 +92,12 @@ public String getVcenterHost() {
8292
public String getDatacenterName() {
8393
return datacenterName;
8494
}
95+
96+
public String getClusterName() {
97+
return clusterName;
98+
}
99+
100+
public String getHostName() {
101+
return hostName;
102+
}
85103
}

api/src/main/java/com/cloud/host/Host.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ public static String[] toStrings(Host.Type... types) {
5757
String HOST_UEFI_ENABLE = "host.uefi.enable";
5858
String HOST_VOLUME_ENCRYPTION = "host.volume.encryption";
5959
String HOST_INSTANCE_CONVERSION = "host.instance.conversion";
60+
String HOST_VDDK_SUPPORT = "host.vddk.support";
61+
String HOST_VDDK_LIB_DIR = "vddk.lib.dir";
62+
String HOST_VDDK_VERSION = "host.vddk.version";
6063
String HOST_OVFTOOL_VERSION = "host.ovftool.version";
6164
String HOST_VIRTV2V_VERSION = "host.virtv2v.version";
6265
String HOST_SSH_PORT = "host.ssh.port";

api/src/main/java/org/apache/cloudstack/api/ApiConstants.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,6 @@ public class ApiConstants {
527527
public static final String SCHEDULE = "schedule";
528528
public static final String SCHEDULE_ID = "scheduleid";
529529
public static final String SCOPE = "scope";
530-
public static final String USER_SECRET_KEY = "usersecretkey";
531530
public static final String SEARCH_BASE = "searchbase";
532531
public static final String SECONDARY_IP = "secondaryip";
533532
public static final String SECURITY_GROUP_IDS = "securitygroupids";
@@ -631,6 +630,8 @@ public class ApiConstants {
631630
public static final String USERNAME = "username";
632631
public static final String USER_CONFIGURABLE = "userconfigurable";
633632
public static final String USER_SECURITY_GROUP_LIST = "usersecuritygrouplist";
633+
public static final String USER_SECRET_KEY = "usersecretkey";
634+
public static final String USE_VDDK = "usevddk";
634635
public static final String USE_VIRTUAL_NETWORK = "usevirtualnetwork";
635636
public static final String USE_VIRTUAL_ROUTER_IP_RESOLVER = "userouteripresolver";
636637
public static final String UPDATE_IN_SEQUENCE = "updateinsequence";

api/src/main/java/org/apache/cloudstack/api/BaseCmd.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import java.util.Iterator;
2828
import java.util.List;
2929
import java.util.Map;
30-
import java.util.UUID;
3130
import java.util.regex.Pattern;
3231

3332
import javax.inject.Inject;
@@ -504,12 +503,6 @@ public Map<String, String> convertExternalDetailsToMap(Map externalDetails) {
504503
}
505504

506505
public String getResourceUuid(String parameterName) {
507-
UUID resourceUuid = CallContext.current().getApiResourceUuid(parameterName);
508-
509-
if (resourceUuid != null) {
510-
return resourceUuid.toString();
511-
}
512-
513-
return null;
506+
return CallContext.current().getApiResourceUuid(parameterName);
514507
}
515508
}

api/src/main/java/org/apache/cloudstack/api/command/admin/vm/ImportVmCmd.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,14 @@ public class ImportVmCmd extends ImportUnmanagedInstanceCmd {
179179
description = "(only for importing VMs from VMware to KVM) optional - the ID of the guest OS for the imported VM.")
180180
private Long guestOsId;
181181

182+
@Parameter(name = ApiConstants.USE_VDDK,
183+
type = CommandType.BOOLEAN,
184+
since = "4.22.1",
185+
description = "(only for importing VMs from VMware to KVM) optional - if true, uses VDDK on the KVM conversion host for converting the VM. " +
186+
"This parameter is mutually exclusive with " + ApiConstants.FORCE_MS_TO_IMPORT_VM_FILES + ".")
187+
private Boolean useVddk;
188+
189+
182190
/////////////////////////////////////////////////////
183191
/////////////////// Accessors ///////////////////////
184192
/////////////////////////////////////////////////////
@@ -255,6 +263,10 @@ public Long getStoragePoolId() {
255263
return storagePoolId;
256264
}
257265

266+
public boolean getUseVddk() {
267+
return BooleanUtils.toBooleanDefaultIfNull(useVddk, true);
268+
}
269+
258270
public String getTmpPath() {
259271
return tmpPath;
260272
}

api/src/main/java/org/apache/cloudstack/api/command/user/bucket/DeleteBucketCmd.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.apache.cloudstack.api.command.user.bucket;
1818

1919
import com.cloud.exception.ConcurrentOperationException;
20+
import com.cloud.exception.ResourceAllocationException;
2021
import org.apache.cloudstack.acl.RoleType;
2122
import org.apache.cloudstack.storage.object.Bucket;
2223
import com.cloud.user.Account;
@@ -82,7 +83,7 @@ public ApiCommandResourceType getApiResourceType() {
8283
}
8384

8485
@Override
85-
public void execute() throws ConcurrentOperationException {
86+
public void execute() throws ConcurrentOperationException, ResourceAllocationException {
8687
CallContext.current().setEventDetails("Bucket ID: " + getResourceUuid(ApiConstants.ID));
8788
boolean result = _bucketService.deleteBucket(id, CallContext.current().getCallingAccount());
8889
SuccessResponse response = new SuccessResponse(getCommandName());

api/src/main/java/org/apache/cloudstack/backup/BackupManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public interface BackupManager extends BackupService, Configurable, PluggableSer
235235
* @param forced Indicates if backup will be force removed or not
236236
* @return returns operation success
237237
*/
238-
boolean deleteBackup(final Long backupId, final Boolean forced);
238+
boolean deleteBackup(final Long backupId, final Boolean forced) throws ResourceAllocationException;
239239

240240
void validateBackupForZone(Long zoneId);
241241

api/src/main/java/org/apache/cloudstack/context/CallContext.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ protected Stack<CallContext> initialValue() {
6363
private User user;
6464
private long userId;
6565
private final Map<Object, Object> context = new HashMap<Object, Object>();
66-
private final Map<String, UUID> apiResourcesUuids = new HashMap<>();
66+
private final Map<String, String> apiResourcesUuids = new HashMap<>();
6767
private Project project;
6868
private String apiName;
6969

@@ -389,11 +389,11 @@ public void setEventDisplayEnabled(boolean eventDisplayEnabled) {
389389
isEventDisplayEnabled = eventDisplayEnabled;
390390
}
391391

392-
public UUID getApiResourceUuid(String paramName) {
392+
public String getApiResourceUuid(String paramName) {
393393
return apiResourcesUuids.get(paramName);
394394
}
395395

396-
public void putApiResourceUuid(String paramName, UUID uuid) {
396+
public void putApiResourceUuid(String paramName, String uuid) {
397397
apiResourcesUuids.put(paramName, uuid);
398398
}
399399

0 commit comments

Comments
 (0)