salt icon indicating copy to clipboard operation
salt copied to clipboard

How to convert existing VM into template from vmware driver

Open anandnevase opened this issue 10 years ago • 5 comments

Description of Issue/Question

How to convert existing VM into template from vmware driver?? Similar thing we can do from vCenter GUI.

Currently we can clone a VM and create template out of it using following config:

$ cat /etc/salt/cloud.profiles 
vm_profile:
  provider: vcenter
  clonefrom: test-vm
  template: true
  folder: 'VMs'
  deploy: False

$ salt-cloud -p  vm_profile  'vm_template' -l debug

But how can i convert already existing VM to Template??

anandnevase avatar Apr 26 '16 06:04 anandnevase

Ping @nmadhok. @anandnevase, you may also want to ask on the salt-users mailing list.

jfindlay avatar Apr 26 '16 16:04 jfindlay

@anandnevase @jfindlay That functionality currently doesn't exist but should be pretty easy to add (since the code for it already exists). You can currently clone a VM to a template and then destroy the original VM.

nmadhok avatar Apr 26 '16 17:04 nmadhok

@nmadhok Creating template using VM cloning is not good option. As per pyvmomi documentation, we can use MarkAsTemplate() method to convert existing VM into template.

anandnevase avatar Apr 27 '16 04:04 anandnevase

@anandnevase Will look into adding the functionality sometime soon.

nmadhok avatar Apr 27 '16 07:04 nmadhok

Fixed in #43980, could be close now.

RootMePLS avatar Apr 03 '18 13:04 RootMePLS