From 44b9309d4d5f7e40b8ff42d7302202d83dc79cbf Mon Sep 17 00:00:00 2001 From: pram0596 <86604033+pram0596@users.noreply.github.com> Date: Mon, 31 Mar 2025 14:12:57 +0530 Subject: [PATCH 1/8] Create 2025-03-31-VMware to OpenStack Migration using virt-v2v.md Submitting for the blog based on internal discussion to migrate a vm from vmware to openstack. --- ...e to OpenStack Migration using virt-v2v.md | 298 ++++++++++++++++++ 1 file changed, 298 insertions(+) create mode 100644 docs/blog/posts/2025-03-31-VMware to OpenStack Migration using virt-v2v.md diff --git a/docs/blog/posts/2025-03-31-VMware to OpenStack Migration using virt-v2v.md b/docs/blog/posts/2025-03-31-VMware to OpenStack Migration using virt-v2v.md new file mode 100644 index 0000000..e37dc93 --- /dev/null +++ b/docs/blog/posts/2025-03-31-VMware to OpenStack Migration using virt-v2v.md @@ -0,0 +1,298 @@ +--- +Date: 2025-03-31 +Title: VMware to OpenStack Migration using virt-v2v +Authors: + - pram0596 +Description: > + Migrate a virtual machine from VMware to OpenStack using vpx. +Categories: + - virt-v2v + - openstack + - migration +--- + +# VMware to OpenStack Migration using virt-v2v + +This document describes the path to migrate a virtual machine from VMware to OpenStack using virt-v2v vpx. You should use vddk plugins to make this process fast for which link is mentioned in the doc. + +**Pre-requisite:** ++ Port 5000 should connect from v2v appliance to OpenStack keystone endpoint. ++ Ports 443,5480 should connect from v2v appliance to VMware vCenter and Esxi hosts. ++ DNS should resolve the VMware hostnames inside the v2v virtual appliance. + +**Environment:** ++ **VMware Cloud** - demo-vmware-cloud.com ++ **OpenStack Cloud keystone public endpoint** - 192.168.10.11 ++ **virt-v2v Virtual appliance** - 192.168.11.11 + + + +**For windows VM migration we need to complete one time additional pre-requites on v2v virtual appliance mentioned on the below link.** + +Coming soon… + +**If you want to use vddk plugins then you need to enable those explicitly using link mentioned below.** + +Coming soon… + +**Steps:** ++ **Create v2v appliance for migration on destination OpenStack Cloud.** +```shell +[root@controller01~]# openstack server create --network NET01 --image ubuntu24 --flavor mig-testing --security-group mig-testing --key-name key01 virt-v2v-appl +[root@controller01~]# openstack server list +``` + ++ **Login to the created virtual appliance and install required package.** +```shell +root@controller01~]# ssh -i .ssh/key01ubuntu@192.168.11.11 +root@virt-v2v-appl$ sudo -i +root@virt-v2v-appl# apt-get update +root@virt-v2v-appl# apt-get upgrade +root@virt-v2v-appl# reboot +root@controller01~]# ssh -i .ssh/key01ubuntu@192.168.11.11 +root@virt-v2v-appl# apt-get install virt-v2v -y +root@virt-v2v-appl# apt-get install python3-openstackclient -y +root@virt-v2v-appl# apt install libvirt-clients -y +``` + ++ **Check if required ports are opened from virtual appliance.** +```shell +root@virt-v2v-appl# nc -vz 192.168.10.11 5000 +root@virt-v2v-appl# nc -vz demo-vmware-cloud.com 443 +root@virt-v2v-appl# nc -vz demo-vmware-cloud.com 5480 +``` + ++ **Copy ca certificate from controller node to virtual appliance.** +```shell +[root@controller01~]# scp -i .ssh/key01/etc/ssl/certs/ca-certificates.crt ubuntu@192.168.11.11:/tmp/ +``` + ++ **Move ca certificate under certs directory on the virtual appliance.** +```shell +[root@controller01~]# ssh -i .ssh/key01ubuntu@192.168.11.11 +root@virt-v2v-appl# mv /tmp/ca-certificates.crt /etc/ssl/certs/ +``` + ++ **Update bashrc file on virtual appliance to update common OpenStack env variables to connect to destination OpenStack Cloud.** +```shell +root@virt-v2v-appl# vim /root/.bashrc +# COMMON OPENSTACK ENVS +export OS_USERNAME=admin +export OS_PASSWORD='xxxxxxxxxxxxxxxxxxxxxxxxxxx' +export OS_PROJECT_NAME=admin +export OS_TENANT_NAME=admin +export OS_AUTH_TYPE=password +export OS_AUTH_URL=https://192.168.10.11:5000/v3 +export OS_NO_CACHE=1 +export OS_USER_DOMAIN_NAME=Default +export OS_PROJECT_DOMAIN_NAME=Default +export OS_REGION_NAME=RegionOne +# For openstackclient +export OS_IDENTITY_API_VERSION=3 +export OS_AUTH_VERSION=3 +export OS_CACERT=/etc/ssl/certs/ca-certificates.crt + +root@virt-v2v-appl# source /root/.bashrc +root@virt-v2v-appl# openstack server list +``` + ++ **Run below command to list guests from source VMware cloud. VPX link can be created using below settings** +'vpx://vcenter.fqdn/datacentername/clustername/hypervisorname?no_verify=1' + +no_verify value could be 0 or 1. If value is 1 it means that SSL verification would be disabled. + +```shell +root@virt-v2v-appl# virsh -c 'vpx://demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1' list --all +Enter username for demo-vmware-cloud.com [administrator@vsphere.local]: domain\user-id +Enter Domain\user-id's password for demo-vmware-cloud.com: +Id Name State +------------------------------------------------------------------------------------ +22 abc1 running +43 abc2 running +1190 xyz1 running +2142 xyz2 running +2144 demo1 running +7018 demo2 running + +``` + ++ **Run below command to move disk from source and upload to OpenStack volume. Before executing the command make sure that VM is in shutdown state.** + ++ **In the command:** +ubuntu20-mig - Guest name on VMware cloud to be migrated +password.txt - Password file created for the VMware domain user on v2v virtual appliance +verify-server-certificate=false +server-id - virt-v2v virtual appliance id + +```shell +root@virt-v2v-appl:~# virt-v2v -ic 'vpx://user-id@demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1' ubuntu20-mig -o openstack -ip password.txt -oo verify-server-certificate=false -oo server-id=45dgftbbfddr6784fhskkei8v8483k' +[ 0.0] Setting up the source: -i libvirt -ic vpx://user-id@demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1 ubuntu20-mig +[ 6.5] Opening the source +[ 89.0] Inspecting the source +[ 561.5] Checking for sufficient free disk space in the guest +[ 561.5] Converting Ubuntu20-mig to run on KVM +virt-v2v: The QEMU Guest Agent will be installed for this guest at first +boot. +virt-v2v: This guest has virtio drivers installed. +[1885.9] Mapping filesystem data to avoid copying unused and blank areas +[1987.6] Closing the overlay +[1987.8] Assigning disks to buses +[1987.8] Checking if the guest needs BIOS or UEFI to boot +virt-v2v: This guest requires UEFI on the target to boot. +[1987.8] Setting up the destination: -o openstack -oo server-id=kk57djj4yuu589037fkkhe5ii3jk +[2004.1] Copying disk 1/1 +█ 100% [****************************************] +[3468.5] Creating output metadata +[3475.6] Finishing off +``` + ++ **If you want to use vddk plugins then execute the steps mentioned in below link and come back here for further steps to be executed.** + +Coming soon… + ++ **You will see a OpenStack volume created on destination OpenStack Cloud.** +```shell +root@virt-v2v-appl:~# openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd --fit ++--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ +| Field | Value | ++--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ +| attachments | [] | +| availability_zone | nova | +| bootable | true | +| consistencygroup_id | None | +| created_at | 2024-11-22T09:31:02.000000 | +| description | ubuntu20-mig disk 1/1 converted by virt-v2v | +| encrypted | False | +| id | rfhyr4565-jj8884j-46d9vj-jjkkrmmchd | +| migration_status | None | +| multiattach | False | +| name | ubuntu20-mig | +| os-vol-host-attr:host | compute02.openstack.cloud.com@ceph#ceph | +| os-vol-mig-status-attr:migstat | None | +| os-vol-mig-status-attr:name_id | None | +| os-vol-tenant-attr:tenant_id | rfhyr4565-jj8884j-46d9vj-jjkkrmmchd | +| properties | virt_v2v_conversion_date='2024/11/22 08:57:51', virt_v2v_disk_index='1/1', virt_v2v_guest_name='ubuntu20-mig', | +| | virt_v2v_version='2.4.0' | +| replication_status | None | +| size | 12 | +| snapshot_id | None | +| source_volid | None | +| status | available | +| type | __DEFAULT__ | +| updated_at | 2024-11-22T09:55:50.000000 | +| user_id | hhfh4i892hjhh5824dkjhaafop49999845jhddg | +| volume_image_metadata | {'architecture': 'x86_64', 'hypervisor_type': 'kvm', 'vm_mode': 'hvm', 'hw_disk_bus': 'virtio', 'hw_vif_model': 'virtio', | +| | 'hw_video_model': 'vga', 'hw_machine_type': 'q35', 'os_type': 'linux', 'os_distro': 'ubuntu', 'hw_cpu_sockets': '1', | +| | 'hw_cpu_cores': '2', 'os_version': '20.04', 'hw_rng_model': 'virtio', 'hw_firmware_type': 'uefi'} | ++--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ +``` + ++ **If source VM has uefi firmware set with secure boot enabled then you need to set boot flag on OpenStack volume additionally.** +```shell +root@virt-v2v-appl:~# openstack volume set --property os_secure_boot=required rfhyr4565-jj8884j-46d9vj-jjkkrmmchd + +root@virt-v2v-appl:~# openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd --fit ++--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ +| Field | Value | ++--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ +| attachments | [] | +| availability_zone | nova | +| bootable | true | +| consistencygroup_id | None | +| created_at | 2024-11-22T09:31:02.000000 | +| description | ubuntu20-mig disk 1/1 converted by virt-v2v | +| encrypted | False | +| id | rfhyr4565-jj8884j-46d9vj-jjkkrmmchd | +| migration_status | None | +| multiattach | False | +| name | ubuntu20-mig-sda | +| os-vol-host-attr:host | compute02.openstack.cloud.com@ceph#ceph | +| os-vol-mig-status-attr:migstat | None | +| os-vol-mig-status-attr:name_id | None | +| os-vol-tenant-attr:tenant_id | rfhyr4565-jj8884j-46d9vj-jjkkrmmchd | +| properties | os_secure_boot='required', virt_v2v_conversion_date='2024/11/22 08:57:51', virt_v2v_disk_index='1/1', virt_v2v_guest_name='ubuntu20-mig' | +| | ubuntu20-mig', virt_v2v_version='2.4.0' | +| replication_status | None | +| size | 12 | +| snapshot_id | None | +| source_volid | None | +| status | available | +| type | __DEFAULT__ | +| updated_at | 2024-11-22T10:23:39.000000 | +| user_id | hhfh4i892hjhh5824dkjhaafop49999845jhddg | +| volume_image_metadata | {'architecture': 'x86_64', 'hypervisor_type': 'kvm', 'vm_mode': 'hvm', 'hw_disk_bus': 'virtio', 'hw_vif_model': 'virtio', | +| | 'hw_video_model': 'vga', 'hw_machine_type': 'q35', 'os_type': 'linux', 'os_distro': 'ubuntu', 'hw_cpu_sockets': '1', | +| | 'hw_cpu_cores': '2', 'os_version': '20.04', 'hw_rng_model': 'virtio', 'hw_firmware_type': 'uefi'} | ++--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ +``` + ++ **Create a new instance using the migrated volume.** +```shell +root@virt-v2v-appl:~# openstack server create --network NET02 --flavor m1.small --security-group mig-testing --key-name key01--volume rfhyr4565-jj8884j-46d9vj-jjkkrmmchd ubuntu20-mig ++--------------------------------------+-------------------------------------------------+ +| Field | Value | ++--------------------------------------+-------------------------------------------------+ +| OS-DCF:diskConfig | MANUAL | +| OS-EXT-AZ:availability_zone | | +| OS-EXT-SRV-ATTR:host | None | +| OS-EXT-SRV-ATTR:hypervisor_hostname | None | +| OS-EXT-SRV-ATTR:instance_name | | +| OS-EXT-STS:power_state | NOSTATE | +| OS-EXT-STS:task_state | scheduling | +| OS-EXT-STS:vm_state | building | +| OS-SRV-USG:launched_at | None | +| OS-SRV-USG:terminated_at | None | +| accessIPv4 | | +| accessIPv6 | | +| addresses | | +| adminPass | Ggdder5632hy | +| config_drive | | +| created | 2024-11-22T10:25:01Z | +| flavor | m1.small (oowuc9995mmchelkjf098345jkjhhj3) | +| hostId | | +| id | 55357fdr-7543-3224-84g3-kkjf677493kkhd | +| image | N/A (booted from volume) | +| key_name | key01 | +| name | ubuntu20-mig | +| os-extended-volumes:volumes_attached | [] | +| progress | 0 | +| project_id | rfhyr4565-jj8884j-46d9vj-jjkkrmmchd | +| properties | | +| security_groups | name=499385-hhfu389-9994-2ff4-dj5lxhj49973jjvnbd' | +| status | BUILD | +| updated | 2024-11-22T10:25:01Z | +| user_id | hhfh4i892hjhh5824dkjhaafop49999845jhddg | ++--------------------------------------+-------------------------------------------------+ + +root@virt-v2v-appl:~# openstack server list ++--------------------------------------+-----------------------+--------+---------------------------+---------------------------------+-------------+ +| ID | Name | Status | Networks | Image | Flavor | ++--------------------------------------+-----------------------+--------+---------------------------+---------------------------------+-------------+ +| 55357fdr-7543-3224-84g3-kkjf677493kkhd | ubuntu20-mig | ACTIVE | NET02=10.240.20.24 | N/A (booted from volume) | m1.small | + +root@virt-v2v-appl:~# ping 10.240.20.24 +PING 10.240.20.24 (10.240.20.24) 56(84) bytes of data. +64 bytes from 10.240.20.24: icmp_seq=1 ttl=64 time=3.59 ms +64 bytes from 10.240.20.24: icmp_seq=2 ttl=64 time=1.08 ms +^C +--- 10.240.20.24 ping statistics --- +2 packets transmitted, 2 received, 0% packet loss, time 1002ms +rtt min/avg/max/mdev = 1.079/2.334/3.590/1.255 ms +``` + ++ **Login to the VM with username created on source and move 99-installer.cfg to allow cloud-init to update the config and ssh keys.** +```shell +root@virt-v2v-appl:~# ssh user-id@10.240.20.24 +root@ubuntu20-mig:~# mv /etc/cloud/cloud.cfg.d/99-installer.cfg /etc/cloud/cloud.cfg.d/99-installer.cfg.bak +root@ubuntu20-mig:~# reboot +``` + ++ **Now you will be able to login using default cloud username and ssh keys.** +```shell +root@virt-v2v-appl:~# ssh -i .ssh/key01 ubuntu@10.240.20.24 +``` + ++ **Remove VMware Tools from the migrated instance.** +```shell +root@ubuntu20-mig:~# apt-get remove --purge open-vm-tools +``` From 0b2c584c330f3303ece2b4e1b7a0c4bdb2d2de91 Mon Sep 17 00:00:00 2001 From: pram0596 <86604033+pram0596@users.noreply.github.com> Date: Mon, 31 Mar 2025 15:08:43 +0530 Subject: [PATCH 2/8] Update 2025-03-31-VMware to OpenStack Migration using virt-v2v.md --- ...-31-VMware to OpenStack Migration using virt-v2v.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/blog/posts/2025-03-31-VMware to OpenStack Migration using virt-v2v.md b/docs/blog/posts/2025-03-31-VMware to OpenStack Migration using virt-v2v.md index e37dc93..94e7164 100644 --- a/docs/blog/posts/2025-03-31-VMware to OpenStack Migration using virt-v2v.md +++ b/docs/blog/posts/2025-03-31-VMware to OpenStack Migration using virt-v2v.md @@ -1,11 +1,11 @@ --- -Date: 2025-03-31 -Title: VMware to OpenStack Migration using virt-v2v -Authors: +date: 2025-03-31 +title: VMware to OpenStack Migration using virt-v2v +authors: - pram0596 -Description: > +description: > Migrate a virtual machine from VMware to OpenStack using vpx. -Categories: +categories: - virt-v2v - openstack - migration From 8e0e108c5e79e882bcb7677a30f3e5ab2e21ac04 Mon Sep 17 00:00:00 2001 From: pram0596 <86604033+pram0596@users.noreply.github.com> Date: Mon, 31 Mar 2025 15:11:56 +0530 Subject: [PATCH 3/8] Rename 2025-03-31-VMware to OpenStack Migration using virt-v2v.md to 2025-03-31-vmware-to-openstack-migration-using-virtv2v.md --- ... => 2025-03-31-vmware-to-openstack-migration-using-virtv2v.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/blog/posts/{2025-03-31-VMware to OpenStack Migration using virt-v2v.md => 2025-03-31-vmware-to-openstack-migration-using-virtv2v.md} (100%) diff --git a/docs/blog/posts/2025-03-31-VMware to OpenStack Migration using virt-v2v.md b/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md similarity index 100% rename from docs/blog/posts/2025-03-31-VMware to OpenStack Migration using virt-v2v.md rename to docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md From b3324670186298c127506e33e94a5aeffbb7b3ce Mon Sep 17 00:00:00 2001 From: pram0596 <86604033+pram0596@users.noreply.github.com> Date: Mon, 31 Mar 2025 16:04:04 +0530 Subject: [PATCH 4/8] Update 2025-03-31-vmware-to-openstack-migration-using-virtv2v.md --- .../2025-03-31-vmware-to-openstack-migration-using-virtv2v.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md b/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md index 94e7164..41985c1 100644 --- a/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md +++ b/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md @@ -8,7 +8,6 @@ description: > categories: - virt-v2v - openstack - - migration --- # VMware to OpenStack Migration using virt-v2v From ecefac6dc6ae705dfe841426ba77cb8d75c5f7cb Mon Sep 17 00:00:00 2001 From: pram0596 <86604033+pram0596@users.noreply.github.com> Date: Mon, 31 Mar 2025 18:21:22 +0530 Subject: [PATCH 5/8] Update 2025-03-31-vmware-to-openstack-migration-using-virtv2v.md Suggested changes has been performed. --- ...re-to-openstack-migration-using-virtv2v.md | 192 +++++++++--------- 1 file changed, 96 insertions(+), 96 deletions(-) diff --git a/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md b/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md index 41985c1..07bb8dd 100644 --- a/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md +++ b/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md @@ -10,121 +10,120 @@ categories: - openstack --- -# VMware to OpenStack Migration using virt-v2v +# VMware to OpenStack Migration using virt-v2v -This document describes the path to migrate a virtual machine from VMware to OpenStack using virt-v2v vpx. You should use vddk plugins to make this process fast for which link is mentioned in the doc. +This document describes the path to migrate a virtual machine from VMware to OpenStack using virt-v2v vpx. You should use vddk plugins to make this process fast for which link is mentioned in the doc. -**Pre-requisite:** -+ Port 5000 should connect from v2v appliance to OpenStack keystone endpoint. -+ Ports 443,5480 should connect from v2v appliance to VMware vCenter and Esxi hosts. -+ DNS should resolve the VMware hostnames inside the v2v virtual appliance. +**Pre-requisite:** ++ Port `5000` should connect from v2v appliance to OpenStack keystone endpoint. ++ Ports `443,5480` should connect from v2v appliance to VMware vCenter and Esxi hosts. ++ DNS should resolve the VMware hostnames inside the v2v virtual appliance. -**Environment:** -+ **VMware Cloud** - demo-vmware-cloud.com -+ **OpenStack Cloud keystone public endpoint** - 192.168.10.11 -+ **virt-v2v Virtual appliance** - 192.168.11.11 +**Environment:** ++ **VMware Cloud** - `demo-vmware-cloud.com` ++ **OpenStack Cloud keystone public endpoint** - `192.168.10.11` ++ **virt-v2v Virtual appliance** - `192.168.11.11` -**For windows VM migration we need to complete one time additional pre-requites on v2v virtual appliance mentioned on the below link.** +**For windows VM migration we need to complete one time additional pre-requites on v2v virtual appliance mentioned on the below link.** Coming soon… -**If you want to use vddk plugins then you need to enable those explicitly using link mentioned below.** +**If you want to use vddk plugins then you need to enable those explicitly using link mentioned below.** Coming soon… -**Steps:** -+ **Create v2v appliance for migration on destination OpenStack Cloud.** +**Steps:** ++ **Create v2v appliance for migration on destination OpenStack Cloud.** ```shell -[root@controller01~]# openstack server create --network NET01 --image ubuntu24 --flavor mig-testing --security-group mig-testing --key-name key01 virt-v2v-appl -[root@controller01~]# openstack server list +[root@controller01~]# openstack server create --network NET01 --image ubuntu24 --flavor mig-testing --security-group mig-testing --key-name key01 virt-v2v-appl +[root@controller01~]# openstack server list ``` -+ **Login to the created virtual appliance and install required package.** ++ **Login to the created virtual appliance and install required package.** ```shell -root@controller01~]# ssh -i .ssh/key01ubuntu@192.168.11.11 -root@virt-v2v-appl$ sudo -i -root@virt-v2v-appl# apt-get update -root@virt-v2v-appl# apt-get upgrade -root@virt-v2v-appl# reboot -root@controller01~]# ssh -i .ssh/key01ubuntu@192.168.11.11 -root@virt-v2v-appl# apt-get install virt-v2v -y -root@virt-v2v-appl# apt-get install python3-openstackclient -y -root@virt-v2v-appl# apt install libvirt-clients -y +[root@controller01~]# ssh -i .ssh/key01ubuntu@192.168.11.11 +[root@virt-v2v-appl]$ sudo -i +[root@virt-v2v-appl]# apt-get update +[root@virt-v2v-appl]# apt-get upgrade +[root@virt-v2v-appl]# reboot +[root@controller01~]# ssh -i .ssh/key01ubuntu@192.168.11.11 +[root@virt-v2v-appl]# apt-get install virt-v2v -y +[root@virt-v2v-appl]# apt-get install python3-openstackclient -y +[root@virt-v2v-appl]# apt install libvirt-clients -y ``` -+ **Check if required ports are opened from virtual appliance.** ++ **Check if required ports are opened from virtual appliance.** ```shell -root@virt-v2v-appl# nc -vz 192.168.10.11 5000 -root@virt-v2v-appl# nc -vz demo-vmware-cloud.com 443 -root@virt-v2v-appl# nc -vz demo-vmware-cloud.com 5480 +[root@virt-v2v-appl]# nc -vz 192.168.10.11 5000 +[root@virt-v2v-appl]# nc -vz demo-vmware-cloud.com 443 +[root@virt-v2v-appl]# nc -vz demo-vmware-cloud.com 5480 ``` -+ **Copy ca certificate from controller node to virtual appliance.** ++ **Copy ca certificate from controller node to virtual appliance.** ```shell -[root@controller01~]# scp -i .ssh/key01/etc/ssl/certs/ca-certificates.crt ubuntu@192.168.11.11:/tmp/ +[root@controller01~]# scp -i .ssh/key01/etc/ssl/certs/ca-certificates.crt ubuntu@192.168.11.11:/tmp/ ``` -+ **Move ca certificate under certs directory on the virtual appliance.** ++ **Move ca certificate under certs directory on the virtual appliance.** ```shell -[root@controller01~]# ssh -i .ssh/key01ubuntu@192.168.11.11 -root@virt-v2v-appl# mv /tmp/ca-certificates.crt /etc/ssl/certs/ +[root@controller01~]# ssh -i .ssh/key01ubuntu@192.168.11.11 +root@virt-v2v-appl# mv /tmp/ca-certificates.crt /etc/ssl/certs/ ``` -+ **Update bashrc file on virtual appliance to update common OpenStack env variables to connect to destination OpenStack Cloud.** ++ **Update bashrc file on virtual appliance to update common OpenStack env variables to connect to destination OpenStack Cloud.** ```shell -root@virt-v2v-appl# vim /root/.bashrc -# COMMON OPENSTACK ENVS -export OS_USERNAME=admin -export OS_PASSWORD='xxxxxxxxxxxxxxxxxxxxxxxxxxx' -export OS_PROJECT_NAME=admin -export OS_TENANT_NAME=admin -export OS_AUTH_TYPE=password -export OS_AUTH_URL=https://192.168.10.11:5000/v3 -export OS_NO_CACHE=1 -export OS_USER_DOMAIN_NAME=Default -export OS_PROJECT_DOMAIN_NAME=Default -export OS_REGION_NAME=RegionOne -# For openstackclient -export OS_IDENTITY_API_VERSION=3 -export OS_AUTH_VERSION=3 -export OS_CACERT=/etc/ssl/certs/ca-certificates.crt - -root@virt-v2v-appl# source /root/.bashrc -root@virt-v2v-appl# openstack server list +[root@virt-v2v-appl]# vim /root/.bashrc +# COMMON OPENSTACK ENVS +export OS_USERNAME=admin +export OS_PASSWORD='xxxxxxxxxxxxxxxxxxxxxxxxxxx' +export OS_PROJECT_NAME=admin +export OS_TENANT_NAME=admin +export OS_AUTH_TYPE=password +export OS_AUTH_URL=https://192.168.10.11:5000/v3 +export OS_NO_CACHE=1 +export OS_USER_DOMAIN_NAME=Default +export OS_PROJECT_DOMAIN_NAME=Default +export OS_REGION_NAME=RegionOne +# For openstackclient +export OS_IDENTITY_API_VERSION=3 +export OS_AUTH_VERSION=3 +export OS_CACERT=/etc/ssl/certs/ca-certificates.crt + +root@[virt-v2v-appl]# source /root/.bashrc +root@[virt-v2v-appl]# openstack server list ``` -+ **Run below command to list guests from source VMware cloud. VPX link can be created using below settings** -'vpx://vcenter.fqdn/datacentername/clustername/hypervisorname?no_verify=1' ++ **Run below command to list guests from source VMware cloud. VPX link can be created using below settings** +`vpx://vcenter.fqdn/datacentername/clustername/hypervisorname?no_verify=1` -no_verify value could be 0 or 1. If value is 1 it means that SSL verification would be disabled. +no_verify value could be `0` or `1`. If value is `1` it means that SSL verification would be disabled. ```shell -root@virt-v2v-appl# virsh -c 'vpx://demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1' list --all -Enter username for demo-vmware-cloud.com [administrator@vsphere.local]: domain\user-id -Enter Domain\user-id's password for demo-vmware-cloud.com: -Id Name State ------------------------------------------------------------------------------------- -22 abc1 running -43 abc2 running -1190 xyz1 running -2142 xyz2 running -2144 demo1 running -7018 demo2 running - +[root@virt-v2v-appl]# virsh -c 'vpx://demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1' list --all +Enter username for demo-vmware-cloud.com [administrator@vsphere.local]: domain\user-id +Enter Domain\user-id's password for demo-vmware-cloud.com: +Id Name State +----------------------------------------------------------------- +22 abc1 running +43 abc2 running +1190 xyz1 running +2142 xyz2 running +2144 demo1 running +7018 demo2 running ``` -+ **Run below command to move disk from source and upload to OpenStack volume. Before executing the command make sure that VM is in shutdown state.** ++ **Run below command to move disk from source and upload to OpenStack volume. Before executing the command make sure that VM is in shutdown state.** -+ **In the command:** -ubuntu20-mig - Guest name on VMware cloud to be migrated -password.txt - Password file created for the VMware domain user on v2v virtual appliance -verify-server-certificate=false -server-id - virt-v2v virtual appliance id ++ **In the command:** +`ubuntu20-mig` - Guest VM name on VMware cloud to be migrated +`password.txt` - Password file created for the VMware domain user on v2v virtual appliance +`verify-server-certificate=false` +`server-id` - virt-v2v virtual appliance id running on OpenStack ```shell -root@virt-v2v-appl:~# virt-v2v -ic 'vpx://user-id@demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1' ubuntu20-mig -o openstack -ip password.txt -oo verify-server-certificate=false -oo server-id=45dgftbbfddr6784fhskkei8v8483k' +[root@virt-v2v-appl:~]# virt-v2v -ic 'vpx://user-id@demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1' ubuntu20-mig -o openstack -ip password.txt -oo verify-server-certificate=false -oo server-id=45dgftbbfddr6784fhskkei8v8483k' [ 0.0] Setting up the source: -i libvirt -ic vpx://user-id@demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1 ubuntu20-mig [ 6.5] Opening the source [ 89.0] Inspecting the source @@ -145,13 +144,13 @@ virt-v2v: This guest requires UEFI on the target to boot. [3475.6] Finishing off ``` -+ **If you want to use vddk plugins then execute the steps mentioned in below link and come back here for further steps to be executed.** ++ **If you want to use vddk plugins then execute the steps mentioned in below link and come back here for further steps to be executed.** Coming soon… -+ **You will see a OpenStack volume created on destination OpenStack Cloud.** ++ **You will see a OpenStack volume created on destination OpenStack Cloud.** ```shell -root@virt-v2v-appl:~# openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd --fit +[root@virt-v2v-appl:~]# openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd --fit +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | Field | Value | +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ @@ -186,11 +185,11 @@ root@virt-v2v-appl:~# openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ ``` -+ **If source VM has uefi firmware set with secure boot enabled then you need to set boot flag on OpenStack volume additionally.** ++ **If source VM has uefi firmware set with secure boot enabled then you need to set boot flag on OpenStack volume additionally.** ```shell -root@virt-v2v-appl:~# openstack volume set --property os_secure_boot=required rfhyr4565-jj8884j-46d9vj-jjkkrmmchd +[root@virt-v2v-appl:~]# openstack volume set --property os_secure_boot=required rfhyr4565-jj8884j-46d9vj-jjkkrmmchd -root@virt-v2v-appl:~# openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd --fit +[root@virt-v2v-appl:~]# openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd --fit +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | Field | Value | +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ @@ -225,9 +224,9 @@ root@virt-v2v-appl:~# openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ ``` -+ **Create a new instance using the migrated volume.** ++ **Create a new instance using the migrated volume.** ```shell -root@virt-v2v-appl:~# openstack server create --network NET02 --flavor m1.small --security-group mig-testing --key-name key01--volume rfhyr4565-jj8884j-46d9vj-jjkkrmmchd ubuntu20-mig +[root@virt-v2v-appl:~]# openstack server create --network NET02 --flavor m1.small --security-group mig-testing --key-name key01--volume rfhyr4565-jj8884j-46d9vj-jjkkrmmchd ubuntu20-mig +--------------------------------------+-------------------------------------------------+ | Field | Value | +--------------------------------------+-------------------------------------------------+ @@ -262,14 +261,15 @@ root@virt-v2v-appl:~# openstack server create --network NET02 --flavor m1.small | updated | 2024-11-22T10:25:01Z | | user_id | hhfh4i892hjhh5824dkjhaafop49999845jhddg | +--------------------------------------+-------------------------------------------------+ - -root@virt-v2v-appl:~# openstack server list +``` +```bash +[root@virt-v2v-appl:~]# openstack server list +--------------------------------------+-----------------------+--------+---------------------------+---------------------------------+-------------+ | ID | Name | Status | Networks | Image | Flavor | +--------------------------------------+-----------------------+--------+---------------------------+---------------------------------+-------------+ | 55357fdr-7543-3224-84g3-kkjf677493kkhd | ubuntu20-mig | ACTIVE | NET02=10.240.20.24 | N/A (booted from volume) | m1.small | -root@virt-v2v-appl:~# ping 10.240.20.24 +[root@virt-v2v-appl:~]# ping 10.240.20.24 PING 10.240.20.24 (10.240.20.24) 56(84) bytes of data. 64 bytes from 10.240.20.24: icmp_seq=1 ttl=64 time=3.59 ms 64 bytes from 10.240.20.24: icmp_seq=2 ttl=64 time=1.08 ms @@ -279,19 +279,19 @@ PING 10.240.20.24 (10.240.20.24) 56(84) bytes of data. rtt min/avg/max/mdev = 1.079/2.334/3.590/1.255 ms ``` -+ **Login to the VM with username created on source and move 99-installer.cfg to allow cloud-init to update the config and ssh keys.** ++ **Login to the VM with username created on source and move 99-installer.cfg to allow cloud-init to update the config and ssh keys.** ```shell -root@virt-v2v-appl:~# ssh user-id@10.240.20.24 -root@ubuntu20-mig:~# mv /etc/cloud/cloud.cfg.d/99-installer.cfg /etc/cloud/cloud.cfg.d/99-installer.cfg.bak -root@ubuntu20-mig:~# reboot +[root@virt-v2v-appl:~]# ssh user-id@10.240.20.24 +[root@ubuntu20-mig:~]# mv /etc/cloud/cloud.cfg.d/99-installer.cfg /etc/cloud/cloud.cfg.d/99-installer.cfg.bak +[root@ubuntu20-mig:~]# reboot ``` -+ **Now you will be able to login using default cloud username and ssh keys.** ++ **Now you will be able to login using default cloud username and ssh keys.** ```shell -root@virt-v2v-appl:~# ssh -i .ssh/key01 ubuntu@10.240.20.24 +[root@virt-v2v-appl:~]# ssh -i .ssh/key01 ubuntu@10.240.20.24 ``` -+ **Remove VMware Tools from the migrated instance.** ++ **Remove VMware Tools from the migrated instance.** ```shell -root@ubuntu20-mig:~# apt-get remove --purge open-vm-tools +[root@ubuntu20-mig:~]# apt-get remove --purge open-vm-tools ``` From c9771f2d2ed38a6d00b46263319f1c9cb0284481 Mon Sep 17 00:00:00 2001 From: pram0596 <86604033+pram0596@users.noreply.github.com> Date: Tue, 1 Apr 2025 12:57:22 +0530 Subject: [PATCH 6/8] Update 2025-03-31-vmware-to-openstack-migration-using-virtv2v.md Proposed changes has been done. --- ...re-to-openstack-migration-using-virtv2v.md | 202 +++++++++++++----- 1 file changed, 146 insertions(+), 56 deletions(-) diff --git a/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md b/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md index 07bb8dd..afc5716 100644 --- a/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md +++ b/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md @@ -1,5 +1,5 @@ --- -date: 2025-03-31 +date: 2025-04-01 title: VMware to OpenStack Migration using virt-v2v authors: - pram0596 @@ -14,67 +14,91 @@ categories: This document describes the path to migrate a virtual machine from VMware to OpenStack using virt-v2v vpx. You should use vddk plugins to make this process fast for which link is mentioned in the doc. -**Pre-requisite:** +I used OpenStack volume on the destination cloud however one can select glance or local basis upon their used cases. + +# Pre-requisite: + Port `5000` should connect from v2v appliance to OpenStack keystone endpoint. + Ports `443,5480` should connect from v2v appliance to VMware vCenter and Esxi hosts. + DNS should resolve the VMware hostnames inside the v2v virtual appliance. -**Environment:** +# Environment: + **VMware Cloud** - `demo-vmware-cloud.com` + **OpenStack Cloud keystone public endpoint** - `192.168.10.11` + **virt-v2v Virtual appliance** - `192.168.11.11` -**For windows VM migration we need to complete one time additional pre-requites on v2v virtual appliance mentioned on the below link.** +# For windows VM migration we need to complete one time additional pre-requites on v2v virtual appliance mentioned on the below link. Coming soon… -**If you want to use vddk plugins then you need to enable those explicitly using link mentioned below.** +# If you want to use vddk plugins then you need to enable those explicitly using link mentioned below. Coming soon… -**Steps:** -+ **Create v2v appliance for migration on destination OpenStack Cloud.** +## Steps: + +# Create v2v appliance for migration on destination OpenStack Cloud. + +**On Controller node** ```shell -[root@controller01~]# openstack server create --network NET01 --image ubuntu24 --flavor mig-testing --security-group mig-testing --key-name key01 virt-v2v-appl -[root@controller01~]# openstack server list +openstack server create --network NET01 \ + --image ubuntu24 \ + --flavor mig-testing \ + --security-group mig-testing \ + --key-name key01 virt-v2v-appl ``` +```bash +openstack server list +``` + +# Login to the created virtual appliance and install required package. -+ **Login to the created virtual appliance and install required package.** +**On Controller node** ```shell -[root@controller01~]# ssh -i .ssh/key01ubuntu@192.168.11.11 -[root@virt-v2v-appl]$ sudo -i -[root@virt-v2v-appl]# apt-get update -[root@virt-v2v-appl]# apt-get upgrade -[root@virt-v2v-appl]# reboot -[root@controller01~]# ssh -i .ssh/key01ubuntu@192.168.11.11 -[root@virt-v2v-appl]# apt-get install virt-v2v -y -[root@virt-v2v-appl]# apt-get install python3-openstackclient -y -[root@virt-v2v-appl]# apt install libvirt-clients -y +ssh -i .ssh/key01ubuntu@192.168.11.11 ``` +**On virt-v2v Appliance** +```bash +sudo -i +apt-get update +apt-get upgrade +reboot +ssh -i .ssh/key01ubuntu@192.168.11.11 +apt-get install virt-v2v -y +apt-get install python3-openstackclient -y +apt install libvirt-clients -y +``` + +# Check if required ports are opened from virtual appliance. -+ **Check if required ports are opened from virtual appliance.** +**On virt-v2v Appliance** ```shell -[root@virt-v2v-appl]# nc -vz 192.168.10.11 5000 -[root@virt-v2v-appl]# nc -vz demo-vmware-cloud.com 443 -[root@virt-v2v-appl]# nc -vz demo-vmware-cloud.com 5480 +nc -vz 192.168.10.11 5000 +nc -vz demo-vmware-cloud.com 443 +nc -vz demo-vmware-cloud.com 5480 ``` -+ **Copy ca certificate from controller node to virtual appliance.** +# Copy ca certificate from controller node to virtual appliance. + +**On Controller node** ```shell -[root@controller01~]# scp -i .ssh/key01/etc/ssl/certs/ca-certificates.crt ubuntu@192.168.11.11:/tmp/ +scp -i ~/.ssh/key01/etc/ssl/certs/ca-certificates.crt ubuntu@192.168.11.11:/tmp/ ``` -+ **Move ca certificate under certs directory on the virtual appliance.** +# Move ca certificate under certs directory on the virtual appliance. + +**On virt-v2v Appliance** ```shell -[root@controller01~]# ssh -i .ssh/key01ubuntu@192.168.11.11 -root@virt-v2v-appl# mv /tmp/ca-certificates.crt /etc/ssl/certs/ +ssh -i ~/.ssh/key01ubuntu@192.168.11.11 +mv /tmp/ca-certificates.crt /etc/ssl/certs/ ``` -+ **Update bashrc file on virtual appliance to update common OpenStack env variables to connect to destination OpenStack Cloud.** +# Update bashrc file on virtual appliance to update common OpenStack env variables to connect to destination OpenStack Cloud. + +**On virt-v2v Appliance** ```shell -[root@virt-v2v-appl]# vim /root/.bashrc +vim /root/.bashrc # COMMON OPENSTACK ENVS export OS_USERNAME=admin export OS_PASSWORD='xxxxxxxxxxxxxxxxxxxxxxxxxxx' @@ -90,20 +114,29 @@ export OS_REGION_NAME=RegionOne export OS_IDENTITY_API_VERSION=3 export OS_AUTH_VERSION=3 export OS_CACERT=/etc/ssl/certs/ca-certificates.crt - -root@[virt-v2v-appl]# source /root/.bashrc -root@[virt-v2v-appl]# openstack server list +``` +```shell +source /root/.bashrc +openstack server list ``` -+ **Run below command to list guests from source VMware cloud. VPX link can be created using below settings** +# Run below command to list guests from source VMware cloud. VPX link can be created using below settings. `vpx://vcenter.fqdn/datacentername/clustername/hypervisorname?no_verify=1` no_verify value could be `0` or `1`. If value is `1` it means that SSL verification would be disabled. +**On virt-v2v Appliance** +```shell +virsh -c 'vpx://demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1' list --all +``` ```shell -[root@virt-v2v-appl]# virsh -c 'vpx://demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1' list --all Enter username for demo-vmware-cloud.com [administrator@vsphere.local]: domain\user-id Enter Domain\user-id's password for demo-vmware-cloud.com: +``` +The command should return hosted vitual machine on particular VMware hypervisor. + +**Example output:** +```shell Id Name State ----------------------------------------------------------------- 22 abc1 running @@ -114,16 +147,26 @@ Id Name State 7018 demo2 running ``` -+ **Run below command to move disk from source and upload to OpenStack volume. Before executing the command make sure that VM is in shutdown state.** +# Run below command to move disk from source and upload to OpenStack volume. Before executing the command make sure that VM is in shutdown state. -+ **In the command:** +**In the command:** `ubuntu20-mig` - Guest VM name on VMware cloud to be migrated `password.txt` - Password file created for the VMware domain user on v2v virtual appliance `verify-server-certificate=false` `server-id` - virt-v2v virtual appliance id running on OpenStack +**On virt-v2v Appliance** ```shell -[root@virt-v2v-appl:~]# virt-v2v -ic 'vpx://user-id@demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1' ubuntu20-mig -o openstack -ip password.txt -oo verify-server-certificate=false -oo server-id=45dgftbbfddr6784fhskkei8v8483k' +virt-v2v -ic 'vpx://user-id@demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1' \ + ubuntu20-mig \ + -o openstack -ip password.txt \ + -oo verify-server-certificate=false \ + -oo server-id='45dgftbbfddr6784fhskkei8v8483k' +``` +Once the command is executed it will capture the snapshot of the Virtual Machine and followed by data copy from VMware Datastore to Openstack Volume. The number of the OpenStack Volume created on the destination would be propotional to the number of disks attached on the Virtual Machine on source while performing migration. + +**Example output:** +```shell [ 0.0] Setting up the source: -i libvirt -ic vpx://user-id@demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1 ubuntu20-mig [ 6.5] Opening the source [ 89.0] Inspecting the source @@ -144,13 +187,18 @@ virt-v2v: This guest requires UEFI on the target to boot. [3475.6] Finishing off ``` -+ **If you want to use vddk plugins then execute the steps mentioned in below link and come back here for further steps to be executed.** +# If you want to use vddk plugins then execute the steps mentioned in below link and come back here for further steps to be executed. Coming soon… -+ **You will see a OpenStack volume created on destination OpenStack Cloud.** +# You will see an OpenStack volume created on destination OpenStack Cloud. + +**On virt-v2v Appliance** ```shell -[root@virt-v2v-appl:~]# openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd --fit +openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd --fit +``` +**Example output:** +```shell +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | Field | Value | +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ @@ -185,11 +233,19 @@ Coming soon… +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ ``` -+ **If source VM has uefi firmware set with secure boot enabled then you need to set boot flag on OpenStack volume additionally.** +# If source VM has uefi firmware set with secure boot enabled then you need to set boot flag on OpenStack volume additionally. + +**On virt-v2v Appliance** +```shell +openstack volume set --property os_secure_boot=required rfhyr4565-jj8884j-46d9vj-jjkkrmmchd +``` ```shell -[root@virt-v2v-appl:~]# openstack volume set --property os_secure_boot=required rfhyr4565-jj8884j-46d9vj-jjkkrmmchd +openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd --fit +``` +The volume property should show `'os_secure_boot=required'` flag on it. -[root@virt-v2v-appl:~]# openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd --fit +**Example output:** +```shell +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | Field | Value | +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ @@ -224,9 +280,20 @@ Coming soon… +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ ``` -+ **Create a new instance using the migrated volume.** +# Create a new instance using the migrated volume. + +**On virt-v2v Appliance** + +```shell +openstack server create --network NET02 \ + --flavor m1.small \ + --security-group mig-testing \ + --key-name key01 \ + --volume rfhyr4565-jj8884j-46d9vj-jjkkrmmchd \ + ubuntu20-mig +``` +**Example output:** ```shell -[root@virt-v2v-appl:~]# openstack server create --network NET02 --flavor m1.small --security-group mig-testing --key-name key01--volume rfhyr4565-jj8884j-46d9vj-jjkkrmmchd ubuntu20-mig +--------------------------------------+-------------------------------------------------+ | Field | Value | +--------------------------------------+-------------------------------------------------+ @@ -263,13 +330,24 @@ Coming soon… +--------------------------------------+-------------------------------------------------+ ``` ```bash -[root@virt-v2v-appl:~]# openstack server list +openstack server list +``` +You should see instance created and in `ACTIVE` state. + +**Example output:** +```bash +--------------------------------------+-----------------------+--------+---------------------------+---------------------------------+-------------+ | ID | Name | Status | Networks | Image | Flavor | +--------------------------------------+-----------------------+--------+---------------------------+---------------------------------+-------------+ | 55357fdr-7543-3224-84g3-kkjf677493kkhd | ubuntu20-mig | ACTIVE | NET02=10.240.20.24 | N/A (booted from volume) | m1.small | +``` +Capture instance IP. -[root@virt-v2v-appl:~]# ping 10.240.20.24 +```shell +ping 10.240.20.24 +``` +**Example output:** +```shell PING 10.240.20.24 (10.240.20.24) 56(84) bytes of data. 64 bytes from 10.240.20.24: icmp_seq=1 ttl=64 time=3.59 ms 64 bytes from 10.240.20.24: icmp_seq=2 ttl=64 time=1.08 ms @@ -279,19 +357,31 @@ PING 10.240.20.24 (10.240.20.24) 56(84) bytes of data. rtt min/avg/max/mdev = 1.079/2.334/3.590/1.255 ms ``` -+ **Login to the VM with username created on source and move 99-installer.cfg to allow cloud-init to update the config and ssh keys.** +# Login to the VM with existing username created on source cloud. Move 99-installer.cfg to allow cloud-init to update the config and ssh keys. + +**On virt-v2v Appliance** + +`user-id`: os username on the source cloud + ```shell -[root@virt-v2v-appl:~]# ssh user-id@10.240.20.24 -[root@ubuntu20-mig:~]# mv /etc/cloud/cloud.cfg.d/99-installer.cfg /etc/cloud/cloud.cfg.d/99-installer.cfg.bak -[root@ubuntu20-mig:~]# reboot +ssh user-id@10.240.20.24 ``` -+ **Now you will be able to login using default cloud username and ssh keys.** +**On migrated Instance** +```shell +mv /etc/cloud/cloud.cfg.d/99-installer.cfg /etc/cloud/cloud.cfg.d/99-installer.cfg.bak +reboot +``` + +# Now you will be able to login using default cloud username and ssh keys. + +**On virt-v2v Appliance** ```shell -[root@virt-v2v-appl:~]# ssh -i .ssh/key01 ubuntu@10.240.20.24 +ssh -i .ssh/key01 ubuntu@10.240.20.24 ``` -+ **Remove VMware Tools from the migrated instance.** +# Remove VMware Tools from the migrated instance. +**On migrated Instance** ```shell -[root@ubuntu20-mig:~]# apt-get remove --purge open-vm-tools +apt-get remove --purge open-vm-tools ``` From 400426027f58a84ee2766519b306aa05fb72d2dd Mon Sep 17 00:00:00 2001 From: pram0596 <86604033+pram0596@users.noreply.github.com> Date: Tue, 1 Apr 2025 13:53:39 +0530 Subject: [PATCH 7/8] Update 2025-03-31-vmware-to-openstack-migration-using-virtv2v.md --- ...re-to-openstack-migration-using-virtv2v.md | 91 ++++++++++--------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md b/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md index afc5716..62f2916 100644 --- a/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md +++ b/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md @@ -8,39 +8,40 @@ description: > categories: - virt-v2v - openstack + - migration --- # VMware to OpenStack Migration using virt-v2v -This document describes the path to migrate a virtual machine from VMware to OpenStack using virt-v2v vpx. You should use vddk plugins to make this process fast for which link is mentioned in the doc. +#### This document describes the path to migrate a virtual machine from VMware to OpenStack using virt-v2v vpx. You should use vddk plugins to make this process fast for which link is mentioned in the doc. -I used OpenStack volume on the destination cloud however one can select glance or local basis upon their used cases. +#### I used OpenStack volume on the destination cloud however one can select glance or local basis upon their used cases. -# Pre-requisite: +## Pre-requisite: + Port `5000` should connect from v2v appliance to OpenStack keystone endpoint. + Ports `443,5480` should connect from v2v appliance to VMware vCenter and Esxi hosts. + DNS should resolve the VMware hostnames inside the v2v virtual appliance. -# Environment: +## Environment: + **VMware Cloud** - `demo-vmware-cloud.com` + **OpenStack Cloud keystone public endpoint** - `192.168.10.11` + **virt-v2v Virtual appliance** - `192.168.11.11` -# For windows VM migration we need to complete one time additional pre-requites on v2v virtual appliance mentioned on the below link. +#### For windows VM migration we need to complete one time additional pre-requites on v2v virtual appliance mentioned on the below link. Coming soon… -# If you want to use vddk plugins then you need to enable those explicitly using link mentioned below. +#### If you want to use vddk plugins then you need to enable those explicitly using link mentioned below. Coming soon… ## Steps: -# Create v2v appliance for migration on destination OpenStack Cloud. ++ ### Create v2v appliance for migration on destination OpenStack Cloud. -**On Controller node** +#### On Controller node ```shell openstack server create --network NET01 \ --image ubuntu24 \ @@ -52,13 +53,13 @@ openstack server create --network NET01 \ openstack server list ``` -# Login to the created virtual appliance and install required package. ++ ### Login to the created virtual appliance and install required package. -**On Controller node** +#### On Controller node ```shell ssh -i .ssh/key01ubuntu@192.168.11.11 ``` -**On virt-v2v Appliance** +#### On virt-v2v Appliance ```bash sudo -i apt-get update @@ -70,33 +71,33 @@ apt-get install python3-openstackclient -y apt install libvirt-clients -y ``` -# Check if required ports are opened from virtual appliance. ++ ### Check if required ports are opened. -**On virt-v2v Appliance** +#### On virt-v2v Appliance ```shell nc -vz 192.168.10.11 5000 nc -vz demo-vmware-cloud.com 443 nc -vz demo-vmware-cloud.com 5480 ``` -# Copy ca certificate from controller node to virtual appliance. ++ ### Copy ca certificate from controller node to virtual appliance. -**On Controller node** +#### On Controller node ```shell scp -i ~/.ssh/key01/etc/ssl/certs/ca-certificates.crt ubuntu@192.168.11.11:/tmp/ ``` -# Move ca certificate under certs directory on the virtual appliance. ++ ### Move ca certificate under certs directory. -**On virt-v2v Appliance** +#### On virt-v2v Appliance ```shell ssh -i ~/.ssh/key01ubuntu@192.168.11.11 mv /tmp/ca-certificates.crt /etc/ssl/certs/ ``` -# Update bashrc file on virtual appliance to update common OpenStack env variables to connect to destination OpenStack Cloud. ++ ### Update bashrc file on virtual appliance to update common OpenStack env variables to connect to destination OpenStack Cloud. -**On virt-v2v Appliance** +#### On virt-v2v Appliance ```shell vim /root/.bashrc # COMMON OPENSTACK ENVS @@ -120,12 +121,12 @@ source /root/.bashrc openstack server list ``` -# Run below command to list guests from source VMware cloud. VPX link can be created using below settings. ++ ### Run below command to list guests from source VMware cloud. VPX link can be created using below settings. `vpx://vcenter.fqdn/datacentername/clustername/hypervisorname?no_verify=1` no_verify value could be `0` or `1`. If value is `1` it means that SSL verification would be disabled. -**On virt-v2v Appliance** +#### On virt-v2v Appliance ```shell virsh -c 'vpx://demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1' list --all ``` @@ -135,7 +136,7 @@ Enter Domain\user-id's password for demo-vmware-cloud.com: ``` The command should return hosted vitual machine on particular VMware hypervisor. -**Example output:** +#### Example output: ```shell Id Name State ----------------------------------------------------------------- @@ -147,15 +148,15 @@ Id Name State 7018 demo2 running ``` -# Run below command to move disk from source and upload to OpenStack volume. Before executing the command make sure that VM is in shutdown state. ++ ### Run below command to move disk from source and upload to OpenStack volume. Before executing the command make sure that VM is in shutdown state. -**In the command:** +#### In the command: `ubuntu20-mig` - Guest VM name on VMware cloud to be migrated `password.txt` - Password file created for the VMware domain user on v2v virtual appliance `verify-server-certificate=false` `server-id` - virt-v2v virtual appliance id running on OpenStack -**On virt-v2v Appliance** +#### On virt-v2v Appliance ```shell virt-v2v -ic 'vpx://user-id@demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1' \ ubuntu20-mig \ @@ -165,7 +166,7 @@ virt-v2v -ic 'vpx://user-id@demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-c ``` Once the command is executed it will capture the snapshot of the Virtual Machine and followed by data copy from VMware Datastore to Openstack Volume. The number of the OpenStack Volume created on the destination would be propotional to the number of disks attached on the Virtual Machine on source while performing migration. -**Example output:** +#### Example output: ```shell [ 0.0] Setting up the source: -i libvirt -ic vpx://user-id@demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1 ubuntu20-mig [ 6.5] Opening the source @@ -187,17 +188,17 @@ virt-v2v: This guest requires UEFI on the target to boot. [3475.6] Finishing off ``` -# If you want to use vddk plugins then execute the steps mentioned in below link and come back here for further steps to be executed. ++ ### If you want to use vddk plugins then execute the steps mentioned in below link and come back here for further steps to be executed. Coming soon… -# You will see an OpenStack volume created on destination OpenStack Cloud. ++ ### You will see an OpenStack volume created on destination OpenStack Cloud. -**On virt-v2v Appliance** +#### On virt-v2v Appliance ```shell openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd --fit ``` -**Example output:** +#### Example output: ```shell +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | Field | Value | @@ -233,9 +234,9 @@ openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd --fit +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ ``` -# If source VM has uefi firmware set with secure boot enabled then you need to set boot flag on OpenStack volume additionally. ++ ### If source VM has uefi firmware set with secure boot enabled then you need to set boot flag on OpenStack volume additionally. -**On virt-v2v Appliance** +#### On virt-v2v Appliance ```shell openstack volume set --property os_secure_boot=required rfhyr4565-jj8884j-46d9vj-jjkkrmmchd ``` @@ -244,7 +245,7 @@ openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd --fit ``` The volume property should show `'os_secure_boot=required'` flag on it. -**Example output:** +#### Example output: ```shell +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | Field | Value | @@ -280,9 +281,9 @@ The volume property should show `'os_secure_boot=required'` flag on it. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ ``` -# Create a new instance using the migrated volume. ++ ### Create a new instance using the migrated volume. -**On virt-v2v Appliance** +#### On virt-v2v Appliance ```shell openstack server create --network NET02 \ @@ -292,7 +293,7 @@ openstack server create --network NET02 \ --volume rfhyr4565-jj8884j-46d9vj-jjkkrmmchd \ ubuntu20-mig ``` -**Example output:** +#### Example output: ```shell +--------------------------------------+-------------------------------------------------+ | Field | Value | @@ -334,7 +335,7 @@ openstack server list ``` You should see instance created and in `ACTIVE` state. -**Example output:** +#### Example output: ```bash +--------------------------------------+-----------------------+--------+---------------------------+---------------------------------+-------------+ | ID | Name | Status | Networks | Image | Flavor | @@ -346,7 +347,7 @@ Capture instance IP. ```shell ping 10.240.20.24 ``` -**Example output:** +#### Example output: ```shell PING 10.240.20.24 (10.240.20.24) 56(84) bytes of data. 64 bytes from 10.240.20.24: icmp_seq=1 ttl=64 time=3.59 ms @@ -357,9 +358,9 @@ PING 10.240.20.24 (10.240.20.24) 56(84) bytes of data. rtt min/avg/max/mdev = 1.079/2.334/3.590/1.255 ms ``` -# Login to the VM with existing username created on source cloud. Move 99-installer.cfg to allow cloud-init to update the config and ssh keys. ++ ### Login to the VM with existing username created on source cloud. Move 99-installer.cfg to allow cloud-init to update the config and ssh keys. -**On virt-v2v Appliance** +#### On virt-v2v Appliance `user-id`: os username on the source cloud @@ -367,21 +368,21 @@ rtt min/avg/max/mdev = 1.079/2.334/3.590/1.255 ms ssh user-id@10.240.20.24 ``` -**On migrated Instance** +#### On migrated Instance ```shell mv /etc/cloud/cloud.cfg.d/99-installer.cfg /etc/cloud/cloud.cfg.d/99-installer.cfg.bak reboot ``` -# Now you will be able to login using default cloud username and ssh keys. ++ ### Now you will be able to login using default cloud username and ssh keys. -**On virt-v2v Appliance** +#### On virt-v2v Appliance ```shell ssh -i .ssh/key01 ubuntu@10.240.20.24 ``` -# Remove VMware Tools from the migrated instance. -**On migrated Instance** ++ ### Remove VMware Tools from the migrated instance. +#### On migrated Instance ```shell apt-get remove --purge open-vm-tools ``` From 9dc911b3620f62eb832951a5144eb79c26ce626a Mon Sep 17 00:00:00 2001 From: pram0596 <86604033+pram0596@users.noreply.github.com> Date: Wed, 2 Apr 2025 14:49:32 +0530 Subject: [PATCH 8/8] Update 2025-03-31-vmware-to-openstack-migration-using-virtv2v.md Changes performed basis upon the discussion I has with Kevin. --- ...re-to-openstack-migration-using-virtv2v.md | 159 ++++++++++-------- 1 file changed, 90 insertions(+), 69 deletions(-) diff --git a/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md b/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md index 62f2916..a66b6f8 100644 --- a/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md +++ b/docs/blog/posts/2025-03-31-vmware-to-openstack-migration-using-virtv2v.md @@ -13,35 +13,39 @@ categories: # VMware to OpenStack Migration using virt-v2v -#### This document describes the path to migrate a virtual machine from VMware to OpenStack using virt-v2v vpx. You should use vddk plugins to make this process fast for which link is mentioned in the doc. +This document describes the path to migrate a virtual machine from VMware to OpenStack using virt-v2v vpx. You should use vddk plugins to make this process fast for which link is mentioned in the doc. -#### I used OpenStack volume on the destination cloud however one can select glance or local basis upon their used cases. +I used OpenStack volume on the destination cloud however one can select glance or local basis upon their used cases. -## Pre-requisite: +## Pre-requisite + Port `5000` should connect from v2v appliance to OpenStack keystone endpoint. + Ports `443,5480` should connect from v2v appliance to VMware vCenter and Esxi hosts. -+ DNS should resolve the VMware hostnames inside the v2v virtual appliance. ++ DNS should resolve the VMware `hostnames` FQDN inside v2v virtual appliance. -## Environment: -+ **VMware Cloud** - `demo-vmware-cloud.com` -+ **OpenStack Cloud keystone public endpoint** - `192.168.10.11` -+ **virt-v2v Virtual appliance** - `192.168.11.11` +## Additional Pre-requisite for Windows VMs +For windows VM migration we need to complete one time additional pre-requites on v2v virtual appliance mentioned on the below link. + +[Coming soon…](Link) - +## Enable vddk plugins +vddk plugins uses VMware sdk which enables addtional functionalities to be used for the migration. You are required to enable vddk plugins to use them explicitly using link mentioned below. -#### For windows VM migration we need to complete one time additional pre-requites on v2v virtual appliance mentioned on the below link. +[Coming soon…](Link) -Coming soon… +## Environment -#### If you want to use vddk plugins then you need to enable those explicitly using link mentioned below. +Kindly refer below details which is used in this documentation. These IPs, FQDN and Openstack properties can be different in your environment. -Coming soon… ++ **VMware Cloud** - `demo-vmware-cloud.com` ++ **OpenStack Cloud keystone public endpoint** - `192.168.10.11` ++ **virt-v2v Virtual appliance** - `192.168.11.11` -## Steps: +## Steps -+ ### Create v2v appliance for migration on destination OpenStack Cloud. +### Create v2v appliance +Run below command on destination OpenStack cloud. Make sure that you have already created the required `tenant network`, `image`, `flavor`, `security-group` and `keypair`. Your `tenant network` must reach out to VMware cloud on the ports mentioned above. -#### On Controller node +**On Controller node** ```shell openstack server create --network NET01 \ --image ubuntu24 \ @@ -49,17 +53,19 @@ openstack server create --network NET01 \ --security-group mig-testing \ --key-name key01 virt-v2v-appl ``` +Check if appliance instance has been created and in `ACTIVE` state. ```bash openstack server list ``` -+ ### Login to the created virtual appliance and install required package. - -#### On Controller node +### Install required package on appliance +Login to the appliance creted. You will require `key` associated with `keypair` used to create the appliance. Here I am using `key01` to login which is saved under my home directory. +**On Controller node** ```shell -ssh -i .ssh/key01ubuntu@192.168.11.11 +ssh -i ~/.ssh/key01 ubuntu@192.168.11.11 ``` -#### On virt-v2v Appliance +Execute below commands to install the required packages. +**On virt-v2v Appliance** ```bash sudo -i apt-get update @@ -71,33 +77,35 @@ apt-get install python3-openstackclient -y apt install libvirt-clients -y ``` -+ ### Check if required ports are opened. - -#### On virt-v2v Appliance +### Verify required ports are opened +Make sure that you can reach on the specified ports from appliance to `VMware` and `OpenStack` cloud. +**On virt-v2v Appliance** ```shell nc -vz 192.168.10.11 5000 nc -vz demo-vmware-cloud.com 443 nc -vz demo-vmware-cloud.com 5480 ``` -+ ### Copy ca certificate from controller node to virtual appliance. - -#### On Controller node +### Copy ca certificate +You must need to copy `ca certificate` from `controller` to `appliance`. +**On Controller node** ```shell -scp -i ~/.ssh/key01/etc/ssl/certs/ca-certificates.crt ubuntu@192.168.11.11:/tmp/ +scp -i ~/.ssh/key01 /etc/ssl/certs/ca-certificates.crt ubuntu@192.168.11.11:/tmp/ +ssh -i ~/.ssh/key01 ubuntu@192.168.11.11 ``` -+ ### Move ca certificate under certs directory. - -#### On virt-v2v Appliance +### Move ca certificate +Move ca certificate from `/tmp` directory to `/etc/ssl/certs` +**On virt-v2v Appliance** ```shell -ssh -i ~/.ssh/key01ubuntu@192.168.11.11 +sudo -i mv /tmp/ca-certificates.crt /etc/ssl/certs/ ``` -+ ### Update bashrc file on virtual appliance to update common OpenStack env variables to connect to destination OpenStack Cloud. +### Create bashrc on appliance +Create bashrc file on virtual appliance to update common OpenStack env variables to connect to destination OpenStack Cloud. You can take reference of your exisitng openrc file from OpenStack cloud. -#### On virt-v2v Appliance +**On virt-v2v Appliance** ```shell vim /root/.bashrc # COMMON OPENSTACK ENVS @@ -116,27 +124,30 @@ export OS_IDENTITY_API_VERSION=3 export OS_AUTH_VERSION=3 export OS_CACERT=/etc/ssl/certs/ca-certificates.crt ``` +Source `.bashrc` file created and run OpenStack command to check if appliance can talk to OpenStack apis. ```shell source /root/.bashrc openstack server list ``` -+ ### Run below command to list guests from source VMware cloud. VPX link can be created using below settings. +### List hosted virtual machines +Run below command to list guests from source VMware cloud. VPX link can be created using below settings. `vpx://vcenter.fqdn/datacentername/clustername/hypervisorname?no_verify=1` no_verify value could be `0` or `1`. If value is `1` it means that SSL verification would be disabled. -#### On virt-v2v Appliance +**On virt-v2v Appliance** ```shell virsh -c 'vpx://demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1' list --all ``` +Provide existing VMware `username` and `password` ```shell Enter username for demo-vmware-cloud.com [administrator@vsphere.local]: domain\user-id Enter Domain\user-id's password for demo-vmware-cloud.com: ``` -The command should return hosted vitual machine on particular VMware hypervisor. +The command should return hosted vitual machine on particular VMware hypervisor mentioned in vpx link. -#### Example output: +Example output: ```shell Id Name State ----------------------------------------------------------------- @@ -148,15 +159,16 @@ Id Name State 7018 demo2 running ``` -+ ### Run below command to move disk from source and upload to OpenStack volume. Before executing the command make sure that VM is in shutdown state. +### Migrate disk +Run below command to move disk from source cloud and upload to OpenStack volume. Before executing the command make sure guest VM is in shutdown state on VMware. -#### In the command: +In the command: `ubuntu20-mig` - Guest VM name on VMware cloud to be migrated `password.txt` - Password file created for the VMware domain user on v2v virtual appliance `verify-server-certificate=false` -`server-id` - virt-v2v virtual appliance id running on OpenStack +`server-id` - virt-v2v virtual appliance id running on OpenStack -#### On virt-v2v Appliance +**On virt-v2v Appliance** ```shell virt-v2v -ic 'vpx://user-id@demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1' \ ubuntu20-mig \ @@ -164,9 +176,9 @@ virt-v2v -ic 'vpx://user-id@demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-c -oo verify-server-certificate=false \ -oo server-id='45dgftbbfddr6784fhskkei8v8483k' ``` -Once the command is executed it will capture the snapshot of the Virtual Machine and followed by data copy from VMware Datastore to Openstack Volume. The number of the OpenStack Volume created on the destination would be propotional to the number of disks attached on the Virtual Machine on source while performing migration. +Once the command is executed it will capture the snapshot of the Virtual Machine and followed by data copy from VMware Datastore to Openstack Volume. The number of the OpenStack Volume created on the destination would be propotional to the number of disks attached on the Virtual Machine on source while performing migration. -#### Example output: +Example output: ```shell [ 0.0] Setting up the source: -i libvirt -ic vpx://user-id@demo-vmware-cloud.com/DC1/DC1-Cluster-02/demo-hyp1-cloud.com?no_verify=1 ubuntu20-mig [ 6.5] Opening the source @@ -188,17 +200,18 @@ virt-v2v: This guest requires UEFI on the target to boot. [3475.6] Finishing off ``` -+ ### If you want to use vddk plugins then execute the steps mentioned in below link and come back here for further steps to be executed. +If you want to use vddk plugins then execute the steps mentioned in below link and come back here for further steps to be executed. -Coming soon… +[Coming soon…](Link) -+ ### You will see an OpenStack volume created on destination OpenStack Cloud. +### Verify migrated disk +Once disk migration is successful, you will see OpenStack volume created on destination. -#### On virt-v2v Appliance +**On virt-v2v Appliance** ```shell openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd --fit ``` -#### Example output: +Example output: ```shell +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | Field | Value | @@ -234,18 +247,20 @@ openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd --fit +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ ``` -+ ### If source VM has uefi firmware set with secure boot enabled then you need to set boot flag on OpenStack volume additionally. +### Set additional flags on Volume +If source VM has `uefi` firmware set with `secure boot` enabled then you need to set boot `flag` on OpenStack volume additionally. -#### On virt-v2v Appliance +**On virt-v2v Appliance** ```shell openstack volume set --property os_secure_boot=required rfhyr4565-jj8884j-46d9vj-jjkkrmmchd ``` +Check if flag is set on the volume. ```shell openstack volume show rfhyr4565-jj8884j-46d9vj-jjkkrmmchd --fit ``` The volume property should show `'os_secure_boot=required'` flag on it. -#### Example output: +Example output: ```shell +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | Field | Value | @@ -281,9 +296,10 @@ The volume property should show `'os_secure_boot=required'` flag on it. +--------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ ``` -+ ### Create a new instance using the migrated volume. +### Create instance with volume +Create new instance using migrated volume. I used `NET02` as a production tenant network. You can choose `flavor`, `security-group`, `keypair` and `network` basis upon your environment. `volume` must the `name/id` of the migrated volume created. -#### On virt-v2v Appliance +**On virt-v2v Appliance** ```shell openstack server create --network NET02 \ @@ -293,7 +309,7 @@ openstack server create --network NET02 \ --volume rfhyr4565-jj8884j-46d9vj-jjkkrmmchd \ ubuntu20-mig ``` -#### Example output: +Example output: ```shell +--------------------------------------+-------------------------------------------------+ | Field | Value | @@ -330,24 +346,26 @@ openstack server create --network NET02 \ | user_id | hhfh4i892hjhh5824dkjhaafop49999845jhddg | +--------------------------------------+-------------------------------------------------+ ``` +Check if instance is created successfully. ```bash openstack server list +openstack server show 55357fdr-7543-3224-84g3-kkjf677493kkhd --fit ``` -You should see instance created and in `ACTIVE` state. +You should see instance created and in `ACTIVE/RUNNING` state. -#### Example output: +Example output: ```bash +--------------------------------------+-----------------------+--------+---------------------------+---------------------------------+-------------+ | ID | Name | Status | Networks | Image | Flavor | +--------------------------------------+-----------------------+--------+---------------------------+---------------------------------+-------------+ | 55357fdr-7543-3224-84g3-kkjf677493kkhd | ubuntu20-mig | ACTIVE | NET02=10.240.20.24 | N/A (booted from volume) | m1.small | ``` -Capture instance IP. +Capture instance IP and see if you can reach to it. ```shell ping 10.240.20.24 ``` -#### Example output: +Example output: ```shell PING 10.240.20.24 (10.240.20.24) 56(84) bytes of data. 64 bytes from 10.240.20.24: icmp_seq=1 ttl=64 time=3.59 ms @@ -358,31 +376,34 @@ PING 10.240.20.24 (10.240.20.24) 56(84) bytes of data. rtt min/avg/max/mdev = 1.079/2.334/3.590/1.255 ms ``` -+ ### Login to the VM with existing username created on source cloud. Move 99-installer.cfg to allow cloud-init to update the config and ssh keys. - -#### On virt-v2v Appliance +### Login to instance +Login to the instance with existing username created on source cloud. Move 99-installer.cfg to allow cloud-init to update config and ssh keys. -`user-id`: os username on the source cloud +**On virt-v2v Appliance** +`user-id`: existing VM username on the source cloud ```shell ssh user-id@10.240.20.24 ``` -#### On migrated Instance +**On migrated Instance** ```shell mv /etc/cloud/cloud.cfg.d/99-installer.cfg /etc/cloud/cloud.cfg.d/99-installer.cfg.bak reboot ``` -+ ### Now you will be able to login using default cloud username and ssh keys. +### Login using default user +Now you will be able to login using default cloud username `ubuntu` and `ssh` keys. -#### On virt-v2v Appliance +**On virt-v2v Appliance** ```shell ssh -i .ssh/key01 ubuntu@10.240.20.24 ``` -+ ### Remove VMware Tools from the migrated instance. -#### On migrated Instance +### Uninstall VMware residuals +Execute below command to remove VMware Tools from the migrated instance. + +**On migrated Instance** ```shell apt-get remove --purge open-vm-tools -``` +```