Skip to content

Added vddk support in vmware to kvm migrations#12970

Draft
harikrishna-patnala wants to merge 18 commits intoapache:4.22from
shapeblue:Introduce-vddk-in-vmware-to-kvm-migrations-422
Draft

Added vddk support in vmware to kvm migrations#12970
harikrishna-patnala wants to merge 18 commits intoapache:4.22from
shapeblue:Introduce-vddk-in-vmware-to-kvm-migrations-422

Conversation

@harikrishna-patnala
Copy link
Copy Markdown
Member

@harikrishna-patnala harikrishna-patnala commented Apr 7, 2026

Description

This PR introduces the VDDK implementation as part of VMware to KVM migration which reduces the migration time by half when compared to the existing implementation with exportOVF

Solution: Introduce VDDK configuration at both the host agent level and per-API-call level, wired through the migration execution pipeline on the KVM host.


Key Capabilities

Capability Detail
Host-level config Four new agent.properties keys configure VDDK defaults per KVM host
API-level overrides Callers can pass VDDK settings via importVm details, overriding host defaults
Secure password handling vCenter password written to a temp file, passed via -ip or --password-file based on virt-v2v version, and deleted immediately after use
Auto-thumbprint fetch If no thumbprint is configured, it is automatically retrieved from vCenter via openssl s_client

Configuration Keys

libguestfs.backend   # LIBGUESTFS backend (default: direct)
vddk.lib.dir         # Path to VDDK library directory
vddk.transports      # Transport preference, e.g. nbd:nbdssl
vddk.thumbprint      # vCenter SHA1 thumbprint (auto-fetched if unset)

Precedence

API details  >  agent.properties

Doc PR: apache/cloudstack-documentation#640

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@harikrishna-patnala harikrishna-patnala force-pushed the Introduce-vddk-in-vmware-to-kvm-migrations-422 branch from b95cfb7 to 7dc5d50 Compare April 7, 2026 04:48
@harikrishna-patnala
Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@harikrishna-patnala a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@harikrishna-patnala harikrishna-patnala added this to the 4.22.1 milestone Apr 7, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 32.40938% with 317 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.62%. Comparing base (4708121) to head (aa710bd).
⚠️ Report is 17 commits behind head on 4.22.

Files with missing lines Patch % Lines
...ervisor/kvm/resource/LibvirtComputingResource.java 5.35% 106 Missing ⚠️
.../wrapper/LibvirtConvertInstanceCommandWrapper.java 48.02% 82 Missing and 10 partials ⚠️
.../apache/cloudstack/vm/UnmanagedVMsManagerImpl.java 46.51% 25 Missing and 21 partials ⚠️
...va/com/cloud/agent/api/ConvertInstanceCommand.java 0.00% 30 Missing ⚠️
...java/com/cloud/agent/manager/AgentManagerImpl.java 0.00% 17 Missing ⚠️
...m/cloud/agent/api/CheckConvertInstanceCommand.java 29.41% 12 Missing ⚠️
.../java/com/cloud/agent/api/to/RemoteInstanceTO.java 23.07% 10 Missing ⚠️
...e/cloudstack/api/command/admin/vm/ImportVmCmd.java 0.00% 3 Missing ⚠️
...per/LibvirtCheckConvertInstanceCommandWrapper.java 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #12970      +/-   ##
============================================
+ Coverage     17.60%   17.62%   +0.01%     
- Complexity    15677    15703      +26     
============================================
  Files          5918     5918              
  Lines        531681   532250     +569     
  Branches      65005    65107     +102     
============================================
+ Hits          93623    93792     +169     
- Misses       427498   427867     +369     
- Partials      10560    10591      +31     
Flag Coverage Δ
uitests 3.70% <ø> (-0.01%) ⬇️
unittests 18.69% <32.40%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@harikrishna-patnala
Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@harikrishna-patnala a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@harikrishna-patnala
Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@harikrishna-patnala a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17380

@harikrishna-patnala
Copy link
Copy Markdown
Member Author

@blueorangutan package

# Instance conversion VIRT_V2V_TMPDIR env var
#convert.instance.env.virtv2v.tmpdir=

# LIBGUESTFS backend to use for VMware to KVM conversion via VDDK (default: direct)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should keep other possible options in the comment (other than direct) ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if direct is the only option supported for vddk, can remove this config?

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17411

}
if (!volumeApiService.doesStoragePoolSupportDiskOffering(selectedStoragePool, rootDiskOffering)) {
throw new InvalidParameterValueException(String.format("The root disk offering '%s' is not supported by the selected conversion storage pool '%s'. " +
"When using VDDK, all selected disk offerings must be compatible with the conversion storage pool, as it will become the primary storage for the imported volumes.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conversion storage pool is option parameter, and for ovf export scenario, secondary storage is used as the default conversion storage. ensure conversion storage pool is set in case of vddk (and update the update the importVm API parameter convertinstancepoolid description that it is the primary storage for vddk enabled conversion).

} else {
host.getDetails().put(Host.HOST_VDDK_VERSION, vddkVersion);
}
updateNeeded = true;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need all these params in host_details? Persisting Host.HOST_VDDK_VERSION should be enough when vddk lib is properly set, to indicate vddk support.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version identification is not just enough to claim the support but we will also need the directory where it is located as we need to pass that in the virt-v2v command with vddk.

@harikrishna-patnala
Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@harikrishna-patnala a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 17420

@harikrishna-patnala
Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@harikrishna-patnala a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17421

@sureshanaparti
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@harikrishna-patnala
Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@harikrishna-patnala a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17446

* Data type: String.<br>
* Default value: <code>direct</code>
*/
public static final Property<String> LIBGUESTFS_BACKEND = new Property<>("libguestfs.backend", "direct", String.class);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static final Property<String> LIBGUESTFS_BACKEND = new Property<>("libguestfs.backend", "direct", String.class);

private int threadsCountToExportOvf = 0;
private String extraParams;
private boolean useVddk;
private String libguestfsBackend;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private String libguestfsBackend;

LOGGER.info("Detected nbdkit VDDK plugin version: {}", vddkVersion);
}

libguestfsBackend = StringUtils.defaultIfBlank(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
libguestfsBackend = StringUtils.defaultIfBlank(

}

libguestfsBackend = StringUtils.defaultIfBlank(
AgentPropertiesFileHandler.getPropertyValue(AgentProperties.LIBGUESTFS_BACKEND), "direct");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
AgentPropertiesFileHandler.getPropertyValue(AgentProperties.LIBGUESTFS_BACKEND), "direct");

private boolean convertInstanceVerboseMode = false;
private Map<String, String> convertInstanceEnv = null;
private String vddkLibDir = null;
private String libguestfsBackend = "direct";
Copy link
Copy Markdown
Contributor

@sureshanaparti sureshanaparti Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private String libguestfsBackend = "direct";
private static final String libguestfsBackend = "direct";

libguestfs has two main backends:

  • libvirt (default)
  • direct (QEMU directly)

The libvirt backend adds an extra virtualization layer and restricts device access and networking paths. This conflicts with how Virtual Disk Development Kit (VDDK) works, which needs direct disk/NBD access. So, need to keep 'direct' for VDDK conversion. No need of any detail/property for this.

private static final List<Storage.StoragePoolType> forceConvertToPoolAllowedTypes =
Arrays.asList(Storage.StoragePoolType.NetworkFilesystem, Storage.StoragePoolType.Filesystem,
Storage.StoragePoolType.SharedMountPoint);
private static final String DETAIL_LIBGUESTFS_BACKEND = "libguestfs.backend";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private static final String DETAIL_LIBGUESTFS_BACKEND = "libguestfs.backend";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants