VM Junkie

February 12, 2009

Clone-VM function

Filed under: powershell, vmware — ermac318 @ 3:46 pm

I added another file to my Sky Drive, it’s a PowerShell function that will Clone a VM using the VI Toolkit. If you’re on ESX 3.5u2 or newer the VM can even be running. This seems like kind of a big oversight in the toolkit – I would have assumed one could pass in an existing VM to the New-VM task, but you can only pass templates, and even those can’t be passed via the pipeline! Very disappointing.

So I wrote this function (with some guidance from forum posts, see the script comments) which does it for you in a fairly straightforward manner. I thought about writing a cmdlet to do it but I saw you needed Visual Studio to write them and my head exploded.

Advertisements

1 Comment

  1. Hi,
    I’ve tried to clone a VM on my VWWare Infrastructure using your script, but I’ve a quiescing problem.
    I don’t want my VM be quiesced. Where I can set this options in your clone script? I know that “quiesce” is an option of snapshot operation, but the clone operation executes automatically a snapshot… or not?
    Thanks
    Franz

    Comment by Franz — December 21, 2009 @ 6:47 am


RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Create a free website or blog at WordPress.com.

%d bloggers like this: