
Convert a Windows Virtual Machine from VMware to SvHCI
This article is intended for administrators wishing to convert an existing Windows virtual machine running on VMware into the format required for migration to StorMagic SvHCI.
Resolution/Information
Scenario
This example demonstrates copying and importing a Windows Server 2016 virtual machine named mc-windows2016.ts.stormagic.com, using IP address 10.10.130.107/24, from VMware to SvHCI.
BIOS configuration:
Network configuration and MAC address:
Prepare the Windows VM for VMware Paravirtual SCSI
- Confirm the base system is installed using UEFI, LSI Logic SAS, and E1000E, as used by the Windows Server 2016 template.
- Install VMware Tools, if not already installed, to ensure the VMXNET3 and VMware Paravirtual SCSI drivers are available.
- Shut down the virtual machine.
- Add a new SCSI controller.
Configure the new controller as VMware Paravirtual. This is typically added as SCSI controller 1.
- Power on the virtual machine so the VMware Paravirtual SCSI driver is loaded into the Windows operating system.
- Confirm the VMware Paravirtual SCSI controller is visible in Device Manager.
- Power down the virtual machine.
- Change SCSI controller 0 from LSI Logic SAS to VMware Paravirtual.
- Remove SCSI controller 1.
- Power on the virtual machine in VMware and confirm it boots successfully.
- Restart it once more to verify the configuration.
- Power down the virtual machine.
- Export the VM to OVF, download the VMDK using the datastore browser, or import it using the StorMagic SvHCI 2.1.0 import utility.
Copy the VMware Virtual Disk Files
Create an Ubuntu Desktop-based VM converter using the following article. Alternative methods may also work, and the qemu-img tools can also be run on Windows.
Create a VMDK / VHD Converter Machine
Enable the sshClient firewall ruleset on the ESXi host.
esxcli network firewall ruleset set --ruleset-id sshClient --enabled=true
Example:
[root@esxi1:/vmfs/volumes/662974cc-8dd200fe-83b8-5cb901d54598/mc-windows-legacy] esxcli network firewall ruleset list --ruleset-id sshClient Name Enabled --------- ------- sshClient false [root@esxi1:/vmfs/volumes/662974cc-8dd200fe-83b8-5cb901d54598/mc-windows-legacy] esxcli network firewall ruleset set --ruleset-id sshClient --enabled=true [root@esxi1:/vmfs/volumes/662974cc-8dd200fe-83b8-5cb901d54598/mc-windows-legacy] esxcli network firewall ruleset list --ruleset-id sshClient Name Enabled --------- ------- sshClient true
Copy both the .vmdk descriptor file and the corresponding -flat.vmdk file to the converter VM.
scp file.txt remote_username@10.10.0.2:/remote/directory
Example of copying the Windows Server 2016 virtual disk files to the converter VM at 10.10.130.108:
[root@esxi1:~] cd /vmfs/volumes/DS7TB-HDD-M-34/mc-windows2016/ [root@esxi1:/vmfs/volumes/63bd7dce-6a484600-fc96-38eaa736818c/mc-windows2016] scp ./mc-windows2016-flat.vmdk mchristie@10.10.130.108:/home/mchristie/ mchristie@10.10.130.108's password: hostfile_replace_entries: link /.ssh/known_hosts to /.ssh/known_hosts.old: Function not implemented update_known_hosts: hostfile_replace_entries failed for /.ssh/known_hosts: Function not implemented mc-windows2016-flat.vmdk 26% 24GB 66.9MB/s 16:52 ETA [root@esxi1:/vmfs/volumes/63bd7dce-6a484600-fc96-38eaa736818c/mc-windows2016] [root@esxi1:/vmfs/volumes/63bd7dce-6a484600-fc96-38eaa736818c/mc-windows2016] scp ./mc-windows2016.vmdk mchristie@10.10.130.108:/home/mchristie/ mchristie@10.10.130.108's password: hostfile_replace_entries: link /.ssh/known_hosts to /.ssh/known_hosts.old: Function not implemented update_known_hosts: hostfile_replace_entries failed for /.ssh/known_hosts: Function not implemented mc-windows2016.vmdk 100% 557 120.7KB/s 00:00 [root@esxi1:/vmfs/volumes/63bd7dce-6a484600-fc96-38eaa736818c/mc-windows2016]
Convert the VMDK to RAW Format
Convert the VMware VMDK into RAW format using the qemu-img utility.
OpenStack Image Conversion Guide
qemu-img convert -f vmdk -O raw image.vmdk image.img
Example:
root@vmdk-converter-vm:/home/mchristie# qemu-img convert -f vmdk -O raw ./mc-windows2016.vmdk ./mc-windows2016.img
The resulting .img file is the RAW disk that will be uploaded into SvHCI.
Upload the RAW Disk to SvHCI
From the Virtual Machines menu, select the option to upload a disk image.
Browse to the converted RAW disk file and upload it to the desired storage pool.
Create the SvHCI Virtual Machine
Record the VMware virtual machine configuration, including CPU, memory, and the network adapter MAC address.
From the Virtual Machines menu, select Create Virtual Machine.
Configure the guest virtual machine and add a VMXNET3 network adapter connected to the appropriate port group. Configure the MAC address to match the original VMware virtual machine.
Preserving the MAC address allows the guest to retain the existing IP address and prevents unnecessary ARP table changes on the network.
Select Add Disk and choose Assign Existing Disk, selecting the RAW disk uploaded earlier.
Create the virtual machine.
Power On the Guest Virtual Machine
Power on the newly created virtual machine.
The guest operating system should start successfully, retaining the original IP address, MAC address, and existing data from the VMware virtual machine.
Once logged in, verify that the operating system, applications, and networking are functioning as expected.
Comments
0 comments
Article is closed for comments.