HPE Morpheus VM Essentials
1822449 Members
2445 Online
109642 Solutions
New Discussion юеВ

Re: Starting and stopping VMs

 
SOLVED
Go to solution
dya
Advisor

Starting and stopping VMs

- Stopping
Can I set how the VM will behave when the host is stopped while the VM is running? Will it stop the VM, or will it be forcibly stopped without stopping the VM, etc.

- Starting
Can I set the VM, including the manager, to start automatically when the host starts? If so, will this apply to all VMs? Can I set it for each VM?

*This is a machine translation, so I apologize if it is difficult to understand.

6 REPLIES 6
babusude
HPE Pro

Re: Starting and stopping VMs

For autostarting the VMs, you can try this. This need to be set for each VM.

virsh list -all <----this should show the list of VMs running.

virsh autostart vm-name <-- this should ensure that the VM is autostarted when host boots up

virsh shutdown vm-name <---to shutdown a VM

To stop a VM from automatically booting, use the --disable
virsh autostart --disable vm-name

 

 



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
cbunge
HPE Pro

Re: Starting and stopping VMs

The default behavior of libvirt is to call a guest shutdown to the running VMs on host shutdown.

As for the startup behavior, I would not rely on the virsh settings to set an autostart flag. That only really works in a single host cluster.  In VME Manager, configure a shared FileSystem datastore (GFS, NFS, CephFS) as a heartbeat LUN.  When the host comes back online the HA actions will occur and power VMs back online.

dya
Advisor

Re: Starting and stopping VMs

When I shut down the host, I manually stopped all VMs.

After that, when I start the host, the VMs do not start automatically.
Is this because I manually stopped the VMs when shutting down the host?

dya
Advisor

Re: Starting and stopping VMs

Additional note:

When I say shutting down the hosts, I mean when I shut down all the hosts.

After that, I started up all the hosts.

cbunge
HPE Pro
Solution

Re: Starting and stopping VMs

If you manually stop the VMs prior to shutting down the hosts, then you would have to  manually start the VMs similar to ESXi.  HA starts only trigger on unexpected stoppages.

dya
Advisor

Re: Starting and stopping VMs

thank you