Import a VHDX as a template via ssh

1 reply
MDMGlobal
13 posts

Is there a way to import a template via ssh and how would you do it?

Thanks Dennis

MDMGlobal
13 posts

I received a response from support and in the interest of closing the loop and helping others here is what was sent:

First create a zfs for the antlet

zfs create antlets/_templates/TEMPLATE_NAME

Copy the vhdx to /antlets/_templates/TEMPLATE_NAME/

Convert the .vhdx to .qcow2

qemu-img convert -f vhdx -O qcow2 image.vhdx TEMPLATE_NAME.qcow2

Delete or move the .vhdx

mv image.vhdx /some/other/dir/

or

rm image.vhdx

Create a snapshot named 'snap'

zfs snapshot antlets/_templates/TEMPLATE_NAME@snap

Create an xml Template

cp /usr/local/antsleOS/xml/kvm-{Blank,TEMPLATE_NAME}.antlet.xml

If a Linux distro you can also try copying the kvm-Blank-virtio.antlet.xml

Just a heads up. Importing hyperV VMs seem to be the most finicky. Gen-1 is more likely to work than Gen-2.

Log in to reply. New here? It takes a minute.