This article is intended for administrators wishing to convert existing Linux virtual machines, using Legacy boot, 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
This example demonstrates the copying a Ubuntu 20.04 VM called mc-plugin.ts.stormagic.com on 10.10.130.9/24 across from VMware, to SvHCI.
Shutdown the guest
Copying the files
Having created a Ubuntu Desktop based VM converter per the below:
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-plugin.ts.stormagic.com] esxcli network firewall ruleset list --ruleset-id sshClient
Name Enabled
--------- -------
sshClient false
[root@esxi1:/vmfs/volumes/662974cc-8dd200fe-83b8-5cb901d54598/mc-plugin.ts.stormagic.com] esxcli network firewall ruleset set --ruleset-id sshClient --enabled=true
[root@esxi1:/vmfs/volumes/662974cc-8dd200fe-83b8-5cb901d54598/mc-plugin.ts.stormagic.com] esxcli network firewall ruleset list --ruleset-id sshClient
Name Enabled
--------- -------
sshClient true
and don't forget to disable afterwards
esxcli network firewall ruleset set --ruleset-id sshClient --enabled=false
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-plugin across to the VM converter on 10.10.130.108
[root@esxi1:/vmfs/volumes/662974cc-8dd200fe-83b8-5cb901d54598/mc-plugin.ts.stormagic.com] scp ./mc-plugin.ts.stormagic.com-flat.vmdk mchristie@10.10.130.108:/home/mchristie/
The authenticity of host '10.10.130.108 (10.10.130.108)' can't be established.
ED25519 key fingerprint is SHA256:ist2c8VCjVPZL8I8xNc8U0yxqYS+FgE15WD/K+hX68s.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.10.130.108' (ED25519) to the list of known hosts.
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-plugin.ts.stormagic.com-flat.vmdk
[root@esxi1:/vmfs/volumes/662974cc-8dd200fe-83b8-5cb901d54598/mc-plugin.ts.stormagic.com] scp ./mc-plugin.ts.stormagic.com.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-plugin.ts.stormagic.com.vmdk
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-plugin.ts.stormagic.com.vmdk ./mc-plugin.ts.stormagic.com.img
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
Compare the VMware VM for CPU/memory and NIC MAC address
Within SvHCI Virtual Machine select to Create a Virtual Machine.
Define the Guest VM name, Guest OS, Boot firmware, select firmware, CPUs and Core count, alongside the virtIO storage controller.
Select to Add Disk, and rather than create a new disk, select to assign an existing disk (that we previously uploaded), per the below:
Select to Add Network, attaching to your configured Port Group and define the MAC address the same as it was in the VMware VM.
This ensures the IP address stays the same and switches aren't modifying ARP tables etc.
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.
See Also
Comments
0 comments
Article is closed for comments.