I need to migrate some clones to our DR site on regular intervalls. I have scripts which basically create certain clones / delete clones etc. but those clones need to be migrated from the SAN in site A to a cluster and NFS store in site B.
Whilst you can do a cold migration (for both host and storage) cross virtual datacenter and it works, it does not work scripted.
I created a nice script which does that - but the vCenter crashes and after long tickets with VMWare (and thinking I messed up) I got the first reply that migrating of both host and storage is not supported (in vSphere 4) when doing so across sites / datacenter and after showing them their documentation saying the exact oposite, they took the easy way out saying that scripts aren't supported.
Script works locally so there isn't anything wrong with it - it just doesn't like moving host and storage at the same time.
Anyway - long story short - as scheduled tasks / manual migration work, I thought I found the solution - but unfortunately the task will be deleted once the VM is being deleted .. (which needs to be done otherwise the clone task will fail as the VM exists).
To make a long story short - I need to find a way to use PowerCLI to create a scheduled task (basically running after the clone has been created and before it is being deleted).
I found quite a few examples on vmware.com and the internet, but neither example talks about migration .. I have tried to use the posted ones and use my migration script to accomblish that to no avail.
Has anyone have more experience in PowerCLI and that and can help me out ?
There are scripts on vmware.com in how to create scheduled tasks to powercycle / power on / power off / clone / delete / snapshot etc but I can''t seem to change them to fit the bill ....
Pwease