This article is intended for administrators wishing to convert existing Windows virtual machines, on VMware, across to the format necessary to upload into SvHCI.
Note: All images are clickable for enlarging, or can be opened in a new tab
Information
Scenario
Note: Ensure the guest VM is bootable on pvSCSI prior to import
This example demonstrates the copying and importing a Windows 2016 VM, called mc-windows2016.ts.stormagic.com, on IP 10.10.130.107/24 across from VMware, to SvHCI.
BIOS:
Network and MAC address
- Base system installed - UEFI, LSI SAS, E1000E (server 2016 template)
- Install vmware tools, if not already present, to install drivers (VMXNET3 and PVSCSI) - reboot.
- Add a new disk (1GB) on a new controller (pvscsi)
- Rescan in device manager to see new controller and disk.
- Verify all working after a reboot.
- Power Down.
- Remove second controller and 1GB Disk.
- Change LSI SAS controller to pvscsi.
- Boot up in VMware - should boot fine, reboot to verify.
- Power down.
- Export to OVF, or pull the VMDK via datastore browser
Copying the files
Having created a Ubuntu Desktop based VM converter per the below, however note that altnerative methods will likely work and in addition the qemu-img tools can also be run on Windows.
Enable sshClient on your ESXi host by running the below example:
esxcli network firewall ruleset set --ruleset-id sshClient --enabled=true
And an example on our system:
[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
We can then SCP both the .vmdk and vmdk flat files across to our converter VM.
scp file.txt remote_username@10.10.0.2:/remote/directory
And an example on our system, copying a VM called mc-veeam-one across to the VM converter on 10.10.130.107
[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 VMDK to RAW.
VMDK Conversion
The vmdk file can be converted to a raw format using qemu-img per the below:
https://docs.openstack.org/image-guide/convert-images.html
qemu-img convert -f vmdk -O raw image.vmdk image.img
And our example:
root@vmdk-converter-vm:/home/mchristie# qemu-img convert -f vmdk -O raw ./mc-windows2016.vmdk ./mc-windows2016.img
With the .img being the converted VMDK file to upload to SvHCI
Upload RAW to SvHCI, attach to existing VM with UEFI, pvscsi, VMXnet3
Uploading the VM disk to SvHCI
Via the Virtual Machines menu select to upload a disk image, browse to the converted file and upload to the correct pools.
Creating the VM on SvHCI and attaching the uploaded disk
Note the VMware VM CPU/memory and NIC MAC address
Within SvHCI Virtual Machine menu select to Create a Virtual Machine.
Define the Guest VM adding a network adapter, in this instance VMXNet3, to the desired port group and defining the MAC address the same as it was in VMware.
This ensures the IP address stays the same and switches aren't modifying ARP tables etc.
Select to Add Disk, and rather than create a new disk, select to assign an existing disk (that we previously uploaded), per the below:
Create the VM
Power on the Guest VM
The guest VM should then start and we can see our IP, MAC address and the files that were existing on the previous VM.
And logged in:
See Also
Comments
0 comments
Article is closed for comments.