Search code examples
virtual-machinexen

Create VM from snapshot in Xen console


I have this snapshot:

# xe snapshot-list
uuid ( RO)                : 00000000-0000-0000-0000-000000000000
          name-label ( RW): ubuntu_clean
    name-description ( RW):
    is-vmss-snapshot ( RO): false

How can I create a VM from it?

On Citrix web documentation, they explain how to do this in XenCenter, unfortunately nothing about xen console: https://docs.citrix.com/en-us/xencenter/6-2/xs-xc-vms/xs-xc-templates-new.html

I found an administration manual, that explains how commands work: https://docs.citrix.com/content/dam/docs/en-us/xenserver/7-1/downloads/xenserver-7-1-administrators-guide.pdf

Even with administration manual it was not clear for me how to create a VM from a snapshot.


Solution

  • You can use snapshots in the same way of templates, so snapshot name and uuid are valid to xe vm-install.

    So, you have two options available:

    # xe vm-install template=ubuntu_clean new-name-label=my_new_vm
    00000000-1111-1111-1111-000000000000
    
    # xe vm-install template-uuid=00000000-0000-0000-0000-000000000000 new-name-label=my_new_vm_2
    00000000-2222-2222-2222-000000000000
    

    It will return VM hash.