Automation

 View Only
  • 1.  Scripted Cold Migration at VM Reboot (Can it be done?)

    Posted Oct 23, 2008 09:42 PM

    I'm exploring an idea here, but first a little back story. We have two sets of ESX servers (Intel and AMD) I need to move systems from one to the other as easily as possible. I know at minimum it will requre a shutdown and a cold migration.

    However, is it possible using the tools available (VirtualCenter, Powershell, etc) to do the following.

    When a target VM reboots, the reboot is "paused" and then a scripted cold migrate occurs, the reboot is "unpaused" and the VM comes back up on the new ESX host. This allows the cold migration to take place with a simple reboot, which on Windows systems occurs monthly.



  • 2.  RE: Scripted Cold Migration at VM Reboot (Can it be done?)

    Posted Oct 23, 2008 10:06 PM

    Well I would propose to look at the possibilities of the VC alarms.

    You can create an alarm for virtual machines and trigger a script when the power state goes from powered on to powered off.

    In that script you could perform your cold migration.

    In the script you could add tests (date, custom attribute...) to avoid incorrect migrations.

    Note: I don't think that a trigger from power off to power on will come in time to perform the migration.



  • 3.  RE: Scripted Cold Migration at VM Reboot (Can it be done?)

    Posted Oct 23, 2008 10:58 PM

    On a reboot, i don't think the system every reports that it's powered off...



  • 4.  RE: Scripted Cold Migration at VM Reboot (Can it be done?)

    Posted Oct 23, 2008 11:02 PM

    Correct, forget about the power off/on trigger for reboots.

    But alarms can also be triggered by the status of the heartbeat.

    Perhaps that could be used.



  • 5.  RE: Scripted Cold Migration at VM Reboot (Can it be done?)

    Posted Oct 23, 2008 10:45 PM

    Do you use VMware Update Manager to patch the guests? Or maybe some other scripted way of patching?

    If you do, you can have the script patch the VM, then suspend it and migrate it the same way that Mike DiPetrillo's script migrates VMs. The critical thing is that you need some sort of event to key off of, VMware can't tell when a guest is rebooting as far as I know.



  • 6.  RE: Scripted Cold Migration at VM Reboot (Can it be done?)

    Posted Oct 23, 2008 11:02 PM

    We do not use VUM to update the guests. We use Altiris which could be used to script it. However I am looking for a solution from the outside of the VM. I am crossing processor types (AMD vs Intel) so it needs to be cold....



  • 7.  RE: Scripted Cold Migration at VM Reboot (Can it be done?)

    Posted Oct 24, 2008 01:26 AM

    Can you script Altiris and have Altiris power the VM down after it patches? That would make it fairly easy to hook it in with a workflow that would migrate the VM.



  • 8.  RE: Scripted Cold Migration at VM Reboot (Can it be done?)

    Posted Oct 24, 2008 02:15 PM

    Since it is difficult to watch for reboots, I would recommend doing this all through Altiris since you already have the workflow (and expertise one would assume) in that tool. You can certainly install PowerShell on your Altiris host or a remote box and script the actions and assemble them into an Altiris job.






    Author of the upcoming book: Managing VMware Infrastructure with PowerShell

    Co-Host, PowerScripting Podcast (http://powerscripting.net)