Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 232869

Re: Clone a template to a specific folder on datastore, with powercli???

$
0
0

Afaik there is no cmdlet available in the current release that allows you to do such a thing.

In fact the VirtualMachineRelocateSpec object, which controls the CloneVM_Task method, only foresees a datastore for the new VM.

That is the SDK API that is used internally by the New-VM cmdlet for cloning a VM from a template.

 

The only way I can think of to do this would be something like this

  • create/clone the new VM
  • unregister the new VM
  • set up a datastore provider to the datastore where the new VM is located
  • create, in the datastore provider, the new folder structure
  • move all the files that constitute the VM from the original folder to the new folder
  • register the VM with the VMX file from the new folder

 

But I'm not sure if nesting folders like that on a datastore is a "best practice".

 

I would go for dedicated folders under the VM and Templates view in the vCenter.

Then you would still have the folder organisation, not on the datastore but in the vCenter.


Viewing all articles
Browse latest Browse all 232869

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>