@@ -117,6 +117,196 @@ If you are hitting the following error when running ovftool, install the depende
117117 dnf install libnsl
118118
119119
120+ VDDK-based Optimized Conversion
121+ -------------------------------
122+
123+ CloudStack supports an optimized VMware-to-KVM migration path using virt-v2v in vpx input mode combined with
124+ VMware's Virtual Disk Development Kit (VDDK). This method eliminates the OVF export phase entirely and streams
125+ disk blocks directly from the source hypervisor into the conversion pipeline, resulting in significantly faster
126+ migration times.
127+
128+ The traditional OVF-based workflow operates in two sequential phases:
129+
130+ 1. Export the entire VM as OVF/VMDK files to temporary storage (full disk copy).
131+ 2. Convert the local VMDK files using virt-v2v (second full disk read and write).
132+
133+ The VDDK-based workflow replaces both phases with a single streaming pipeline:
134+
135+ - virt-v2v connects directly to vCenter via ``vpx:// ``
136+ - Disk blocks are read on demand via VDDK (using nbdkit internally as the translation layer between the
137+ VDDK API and virt-v2v's NBD block device interface)
138+ - Conversion and disk transfer happen concurrently
139+ - Only allocated blocks are transferred; zero-filled and sparse extents are skipped
140+ - No intermediate OVF or VMDK files are created
141+
142+ This reduces disk I/O amplification, eliminates temporary staging storage, and shortens end-to-end migration time.
143+
144+ .. note ::
145+
146+ CloudStack does not distribute VDDK, operators must download it separately.
147+ Along with the new VDDK-based conversion method the traditional OVF-based method remains supported for environments.
148+ Operators can choose the conversion method on a per-migration basis in the UI import wizard.
149+ Host Prerequisites for VDDK-based Conversion
150+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
151+
152+ To use VDDK-based migration, operators must prepare each KVM host that will run the conversion: install the conversion
153+ tools, install VDDK manually, configure libguestfs, and verify host connectivity to vCenter/ESXi.
154+
155+ Example: prepare one KVM conversion host
156+
157+ **Step 1: Install the conversion stack **
158+
159+ Install the required conversion tools on the KVM host. Choose the appropriate command for your distribution:
160+
161+ RHEL / Rocky / Alma Linux:
162+
163+ ::
164+
165+ dnf install -y epel-release
166+ dnf config-manager --set-enabled crb
167+ dnf install -y virt-v2v libguestfs-tools libguestfs-xfs qemu-img nbdkit
168+
169+ Ubuntu:
170+
171+ ::
172+
173+ apt install -y \
174+ virt-v2v \
175+ libguestfs-tools \
176+ libguestfs-xfs \
177+ qemu-utils \
178+ qemu-system-x86 \
179+ libvirt-clients \
180+ nbdkit
181+
182+ **Step 2: Download and install VDDK **
183+
184+ Download the VDDK tarball and extract it on the KVM host. The CloudStack agent will detect the VDDK library
185+ directory from the extracted package layout or it can also be configured explicitly via the ``vddk.lib.dir ``
186+ property in ``/etc/cloudstack/agent/agent.properties ``.
187+
188+ ::
189+
190+ mkdir -p /opt/vmware-vddk
191+ tar -xf VMware-vix-disklib-9*.tar.gz -C /opt/vmware-vddk
192+
193+ Expected layout after extraction::
194+
195+ /opt/vmware-vddk/vmware-vix-disklib-distrib/
196+ lib64/
197+ include/
198+ bin64/
199+
200+ **Step 3: Add EL9 compatibility symlink (when using VDDK 9) **
201+
202+ On EL9 distributions, virt-v2v may expect ``libvixDiskLib.so.8 ``. Create this compatibility symlink:
203+
204+ ::
205+
206+ cd /opt/vmware-vddk/vmware-vix-disklib-distrib/lib64
207+ ln -s libvixDiskLib.so.9 libvixDiskLib.so.8
208+
209+ .. note :: This compatibility symlink is commonly required on RHEL 9, Rocky Linux 9, and Alma Linux 9.
210+
211+ **Step 4: Verify host setup **
212+
213+ ::
214+
215+ ls /opt/vmware-vddk/vmware-vix-disklib-distrib/lib64/libvixDiskLib.so.8
216+ virt-v2v --version
217+ nbdkit --version
218+
219+ **Step 5: Restart the CloudStack agent **
220+
221+ Restart the CloudStack agent service so it detects the installed VDDK library and makes it available in the UI:
222+
223+ ::
224+
225+ systemctl restart cloudstack-agent
226+
227+ After the agent restarts, verify that VDDK installation was detected by checking the host details in the CloudStack UI.
228+
229+ **Step 6: Verify required network and firewall access **
230+
231+ Allow the following ports through any firewall or network security controls between the KVM conversion host and the
232+ VMware endpoints:
233+
234+ .. cssclass :: table-striped table-bordered table-hover
235+
236+ ============================== ====== ==============================
237+ Target Port Purpose
238+ ============================== ====== ==============================
239+ vCenter 443 API / authentication
240+ ESXi hosts 902 VDDK NFC disk transfer
241+ ESXi hosts 443 VM metadata
242+ ============================== ====== ==============================
243+
244+ Agent Properties for VDDK-based Conversion
245+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
246+
247+ The following properties can be configured in ``/etc/cloudstack/agent/agent.properties `` on each KVM host to enable and tune the VDDK-based conversion.
248+ After editing this file, restart the CloudStack agent (``systemctl restart cloudstack-agent ``).
249+ These values can also be passed in details parameters in importVm API as key-value pairs.
250+
251+ .. cssclass :: table-striped table-bordered table-hover
252+
253+ +------------------------+----------------------------------------------------------------------+-------------------------------------------------------+
254+ | Property | Description | Default / Example |
255+ +========================+======================================================================+=======================================================+
256+ | ``vddk.lib.dir `` | Path to the VDDK library directory on the KVM host. | ``/opt/vmware-vddk/vmware-vix-disklib-distrib `` |
257+ | | Passed to virt-v2v as ``-io vddk-libdir=<path> ``. | |
258+ +------------------------+----------------------------------------------------------------------+-------------------------------------------------------+
259+ | ``vddk.transports `` | Ordered VDDK transport preference. | Example: ``nbd:nbdssl `` |
260+ | | Passed as ``-io vddk-transports=<value> `` to virt-v2v. | |
261+ +------------------------+----------------------------------------------------------------------+-------------------------------------------------------+
262+ | ``vddk.thumbprint `` | Optional vCenter SHA1 thumbprint. | If unset, CloudStack computes it automatically on |
263+ | | Passed as ``-io vddk-thumbprint=<value> `` to virt-v2v. | the KVM host via ``openssl ``. |
264+ +------------------------+----------------------------------------------------------------------+-------------------------------------------------------+
265+
266+ Example configuration in ``/etc/cloudstack/agent/agent.properties ``:
267+
268+ ::
269+
270+ # LIBGUESTFS backend to use for VMware to KVM conversion via VDDK (default: direct)
271+ libguestfs.backend=direct
272+
273+ # Path to the VDDK library directory for VMware to KVM conversion via VDDK,
274+ # passed to virt-v2v as -io vddk-libdir=<path>
275+ vddk.lib.dir=/opt/vmware-vddk/vmware-vix-disklib-distrib
276+
277+ # Ordered VDDK transport preference for VMware to KVM conversion via VDDK, passed as
278+ # -io vddk-transports=<value> to virt-v2v. Example: nbd:nbdssl
279+ # vddk.transports=nbd:nbdssl
280+
281+ # Optional vCenter SHA1 thumbprint for VMware to KVM conversion via VDDK, passed as
282+ # -io vddk-thumbprint=<value>. If unset, CloudStack computes it on the KVM host via openssl.
283+ # vddk.thumbprint=
284+
285+
286+ Recommendations for Using VDDK-based Conversion
287+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
288+
289+ **VM state before conversion **
290+
291+ - **Windows VMs **: Must be powered off and gracefully shut down before conversion to ensure the filesystem is in a
292+ clean state.
293+
294+ **Use a single primary storage pool for direct conversion **
295+
296+ When VDDK-based conversion is enabled, it is strongly recommended to configure the conversion to write directly
297+ to the destination primary storage pool (i.e., set *Convert to storage pool directly * to ``true `` in the import wizard).
298+ This eliminates the two-step process of the traditional OVF method, conversion to temporary storage followed by
299+ an import step, replacing it with a single streaming pipeline that writes converted QCOW2 disks directly to the
300+ destination primary storage.
301+
302+ **Network placement for optimal disk transfer throughput **
303+
304+ For best performance, place the KVM conversion host on the same high-bandwidth network as the source ESXi hosts.
305+ VDDK disk transfer uses VMware's NFC protocol on TCP port 902. ESXi routes NFC traffic to the conversion host based
306+ on standard IP routing, if the conversion host is reachable over a dedicated storage or migration network,
307+ ESXi will naturally select that VMkernel interface for disk transfer, keeping bulk data off the management network
308+ without requiring any special configuration in virt-v2v or CloudStack.
309+
120310Usage
121311-----
122312
0 commit comments