The support for migrating VMware instances, and importing KVM instances to a CloudStack-managed KVM environment has been added to CloudStack 4.19.
In this talk, Suresh provides the details about the import/migration process in CloudStack along with a demo, and discusses the future improvements.
-----------------------------------------
The CloudStack India User Group 2024 took place in Hyderabad on 23rd February. The conference, arranged by a group of volunteers from the Apache CloudStack Community, saw multiple sessions held about the cloud orchestration platform and its latest advancements.
5. Introduction
Import Instances to CloudStack (KVM) - 4.19.0
• VMware
• External vCenter
• Managed vCenter
• KVM
• External KVM host
• Disk Images from Storages
#CSIUG2024
6. VMware Migration
• KVM Host Requirements
• Migration Process
*Results may vary depending on the Guest VM OS and KVM hosts distributions and virt-v2v versions
• Pre-Migration: Discovery, Preparation
• Migration: Conversion, Copying, Deployment
• Post-Migration: Cleanup
• Result: Imported Stopped VM
• APIs
• listVmwareDcVms
• importVm
#CSIUG2024
7. KVM Host Requirements
The following packages needs to be installed in KVM hypervisor hosts
• virt-v2v (https://www.libguestfs.org/virt-v2v.1.html)
• nbdkit – on Ubuntu
• apt install nbdkit
• virtio-win – for Windows guest VMs
• yum install virtio-win (RHEL)
• apt install virtio-win (Debian)
#CSIUG2024
8. Migration Process
#CSIUG2024
CloudStack
Management
Server (MS)
Connectivity between VMware
vCenter and KVM host(s) is required
Temporary
Storage Location
virt-v2v output to temporary
storage location:
- Secondary storage
- Primary storage
- Local storage (if enabled)
Destination
Storage Pools Copy VM migrated
disks to destination
storage pools
Converted Instance
Information
Request to convert
VMware Cloned Instance
CloudStack
Database
Import Instance
into Database
importVM API
Source VMware
Clone the source VMware VM
Connectivity between VMware
vCenter and MS is required
9. Migration cmd (virt-v2v) on KVM Host
• virt-v2v
--root first
-ic <URL>
<CLONE_VM_NAME>
--password-file <PASSWORD_FILE>
-o local
-os <STORAGE_MOUNT_POINT>
-of qcow2
-on <OUTPUT_FILES_PREFIX>
Example:
virt-v2v
--root first
-ic vpx://administrator%40vsphere.local@10.0.35.101/Trillian/p1-c1/10.0.34.189?no_verify=1
0f2b4c88-0015-4f98-8499-8301fa2a5eb3
--password-file /tmp/vmw-bdd276b1-37bd-4575-8d2a-8f22619c3155
-o local
-os /mnt/84f43d95-144f-3ecf-8d46-e6a1badec9bd
-of qcow2
-on ba6be8da-86fb-42f5-ab98-143d1139f7ce
#CSIUG2024
12. Migration Tool
(i) Select Source VMware DC
• Existing: Already linked to a CloudStack zone in the cloud environment
• External: Not managed by any CloudStack zone in the cloud
(ii) CloudStack lists VMs on VMware DC
• New API listVmwareDcVms
(iii) Administrator selects a VMware Instance to import
• New API importVM
• Additionally, can also select a KVM host to perform the conversion and/or select the temporary storage for
the conversion
(iv) CloudStack clones the source VM on the source VMware DC
• Clones in “crash consistent” state
(v) KVM Host converts the VMware Instance to KVM through virt-v2v
• Administrator can choose the conversion host and/or the temporary location for the virt-v2v output
(vi) KVM Host invokes virt-v2v to convert a guest VM from VMware to run on libvirt
#CSIUG2024
13. Configuration
Management Server Settings
• convert.vmware.instance.to.kvm.timeout
• Timeout for the long-lasting conversion
process
• Default: 8 hours
#CSIUG2024
KVM Host Agent Parameters
• virtv2v.verbose.enabled
• Increase virt-v2v verbosity
• Default: false
14. Supported VMs & Versions
#CSIUG2024
Destination KVM Hosts Linux Distribution Supported Versions
Alma Linux 8, 9
Red Hat Enterprise Linux 8, 9
Rocky Linux 8, 9
Ubuntu 22.04 LTS
Supported Versions
Supported VMware guest VMs
• Running or Stopped Linux VMs
• Stopped Windows VMs
16. Conclusion & Future Work
• Preserve Disks & Networking
• Requires virt-v2v / other dependencies on KVM hosts
*Results may vary depending on the Guest VM OS and KVM hosts distributions and virt-v2v versions
• Minimize migration time
• Use local copy (cp / url / virt-v2v-copy-to-local)
• Other options?
• Auto Detect Host (with conversion dependencies)
• virt-v2v / other dependencies updates / any other issues
• Data volume import (KVM)
• Any recommendations/thoughts?
[GitHub Issues | GitHub Discussions | Dev, Users Mailing List]
#CSIUG2024