VMware Cloud Community
marke82
Contributor
Contributor

Reboot Virtual Machine After Shutdown

Hi guys! This is my first post!

I'd like to know how to reboot automatically virtual machines in an esx 3.5 cluster infrastructure after a shutdown for power failure...

Is there a script or something else?

Thank you

0 Kudos
7 Replies
djciaro
Expert
Expert

Hi,

When you say reboot automatically do you mean that when the ESX comes back online the VMs do not start? or is it that you want the HA cluster to start the VMs on another host when the power has failed 5to one of your ESX hosts in an VMware HA cluster?

Lets assume that you mean the 1st one:

Configuring Virtual Machine Autostart Settings

The virtual machine autostart settings allow you to configure a startup and shutdown delay for each virtual machine.

To configure virtual machine autostart settings

  • 1. In the Startup Settings group, select either Use default or Use specified settings.

If you select Use specified settings, type a Startup Delay time in seconds. Select or deselect Continue immediately if the VMware Tools start.

  • 2. In the Shutdown Settings group, select either Use default or Use specified settings.

If you select Use specified settings, type a Shutdown Delay time in seconds. Then choose a shutdown action from the Perform shutdown action list.

Regards

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks! :smileygrin:

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!
0 Kudos
marke82
Contributor
Contributor

I mean the second but with all esx down!

0 Kudos
djciaro
Expert
Expert

Customizing HA for Virtual Machines

You can customize HA for restart priority and isolation response:

  • Restart Priority determines the order in which virtual machines are restarted when the host fails. Restart priority is always considered, but is especially important in the following cases:

    • If you've set host failure to a certain number of hosts (for example, three) and more hosts fail (for example, four)

    • If you've turned off strict admission control and started more virtual machines than HA was set up to support

  • Isolation Response determines what happens when a host in an HA cluster loses its console network connection but continues running. By default, virtual machines are powered off in case of a host isolation incident. They are restarted on a different host, and you usually don't want two instances of the same virtual machine running on two different hosts. You can change that behavior for individual virtual machines.

Disk linking usually prevents two instances of a virtual machine from running on two different hosts, but a problem might occur if you're using NAS or iSCSI storage. In that case, VMware recommends that you keep the Isolation Response at Power off (the default).

To customize HA behavior for individual virtual machines

  1. Select the cluster, click the Edit Settings link, and select Virtual Machine Options under VMware HA.

  2. For each virtual machine, select from the Restart Priority pop-up menu to customize its settings.

Restart Priority indicates relative priority for restarting the virtual machine in case of host failure. Higher priority virtual machines are started first.

This priority applies only on a per-host basis. If multiple hosts fail, VirtualCenter first migrates all virtual machines from the first host in order of priority, then all virtual machines from the second host in order of priority, and so on.

  1. For each virtual machine, you can select from the Isolation Response pop-up menu to customize its settings.

Isolation Response specifies what the ESX Server host that has lost connection with its cluster should do with running virtual machines. By default, each virtual machine shuts down if the host becomes isolated.

You can choose from the following options for the isolation response:

    • Power off - The virtual machine powers off if the host can no longer communicate with other hosts in the cluster.

    • Leave powered on - The virtual machine on an isolated host continues to run even if the host can no longer communicate with other hosts in the cluster.

    • Use Cluster Setting - The virtual machine should use the default behavior configured for the cluster on the VMware HA page. See Configuring HA Settings.

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!
0 Kudos
marke82
Contributor
Contributor

I mean when all the hosts of the cluster are down. Not only one host... If the entire cluster goes down, it doesn't restart vms because it doesn't know where they were before...

I'd like to know if there's a script that checks in realtime where vms so after restarting cluster knows where were the vms...

0 Kudos
jyvesd
Enthusiast
Enthusiast

Depending on your esx version (with 3.5 it's ok) you can set this kind of feature per esx. Select your esx server and on the tab 'configuration', go to 'Virtuam machine Startup/shudwon'. There clickt 'properties' and you will be able to configure automatic startup with the system. You are also able to set-up a start up priority.

0 Kudos
marke82
Contributor
Contributor

Using HA the cluster doesn't know where are vms... I know I can configure restarting properties for vms in host but the problem is with cluster and HA... (Not with single host)

0 Kudos
djciaro
Expert
Expert

I think you are misunderstanding the concept of VMware HA.

HA allows us to restart VMs on a different ESX (part of an HA cluster) when an ESX server fails or becomes isolated from the network.

If your entire Cluster fails and later the ESX servers start after power has been restored the VMs will start based on the rules for each ESX host or based on the HA settings:

Perhpas the following will explain the VMware HA policy

Customizing HA for Virtual Machines

You can customize HA for restart priority and isolation response:

  • Restart Priority determines the order in which virtual machines are restarted when the host fails. Restart priority is always considered, but is especially important in the following cases:

    • If you've set host failure to a certain number of hosts (for example, three) and more hosts fail (for example, four)

    • If you've turned off strict admission control and started more virtual machines than HA was set up to support

  • Isolation Response determines what happens when a host in an HA cluster loses its console network connection but continues running. By default, virtual machines are powered off in case of a host isolation incident. They are restarted on a different host, and you usually don't want two instances of the same virtual machine running on two different hosts. You can change that behavior for individual virtual machines.

    Disk linking usually prevents two instances of a virtual machine from running on two different hosts, but a problem might occur if you're using NAS or iSCSI storage. In that case, VMware recommends that you keep the Isolation Response at Power off (the default).

To customize HA behavior for individual virtual machines

  1. Select the cluster, click the Edit Settings link, and select Virtual Machine Options under VMware HA.

  2. For each virtual machine, select from the Restart Priority pop-up menu to customize its settings.

    Restart Priority indicates relative priority for restarting the virtual machine in case of host failure. Higher priority virtual machines are started first.


    This priority applies only on a per-host basis. If multiple hosts fail, VirtualCenter first migrates all virtual machines from the first host in order of priority, then all virtual machines from the second host in order of priority, and so on.

  3. For each virtual machine, you can select from the Isolation Response pop-up menu to customize its settings.

    Isolation Response specifies what the ESX Server host that has lost connection with its cluster should do with running virtual machines. By default, each virtual machine shuts down if the host becomes isolated.


    You can choose from the following options for the isolation response:

    • Power off - The virtual machine powers off if the host can no longer communicate with other hosts in the cluster.

    • Leave powered on - The virtual machine on an isolated host continues to run even if the host can no longer communicate with other hosts in the cluster.

    • Use Cluster Setting - The virtual machine should use the default behavior configured for the cluster on the VMware HA page. See Configuring HA Settings.

If you add a host to a cluster, all virtual machines in the cluster default to a restart priority of Medium and an isolation response of Power off.

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!
0 Kudos