VMware Cloud Community
NJKwork
Enthusiast
Enthusiast
Jump to solution

Scheduled task to delete a VM (clone)

Hi,

I am trying to use the new hot cloning feature of 2.5 U2 as a poor mans DR solution. I have a NFS volume to store clones and would like to use scheduled tasks to weekly create a clone of some live, important VMs. The problem is, if the clone already exists, it will not let me overwrite it...I have to delete it first. I don't want to use a different name, because then I will fill up my NFS volume; I only want one clone of a VM at any one time.

I looked to see if there were any pre-built scheduled tasks to delete a VM, but there are none. Does anyone know a way to make this happen?

Thanks

SB

Reply
0 Kudos
1 Solution

Accepted Solutions
kjb007
Immortal
Immortal
Jump to solution

You can use powershell vi toolkit to remove a vm. You can put that into a script and use it to delete the clone.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB

View solution in original post

Reply
0 Kudos
4 Replies
Kahonu84
Hot Shot
Hot Shot
Jump to solution

Aloha - Why not use a CRON job??

kjb007
Immortal
Immortal
Jump to solution

You can use powershell vi toolkit to remove a vm. You can put that into a script and use it to delete the clone.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
Reply
0 Kudos
NJKwork
Enthusiast
Enthusiast
Jump to solution

Cool - thanks for the reply. I actually saw that option too shortly after posting this question. I will give it a shot.

SB

Reply
0 Kudos
AESamaureira
Contributor
Contributor
Jump to solution

Hi! Could you share the script you created to use as an example? I need to do the same in my infrastructure

Please!

Reply
0 Kudos