Virtual Machine Startup and Shutdown Behavior

From Proxmox VE
Jump to: navigation, search

Contents

Introduction

  • You can configure virtual machines (VM) and containers (CT) to start up and shut down with the host. Additionally, you can set the default timing and start-up order for selected VMs and CTs.
  • Notice:

Configuration

Got to the VM option tab (KVM). First, you need to set the "Start at boot" to "Yes". Second, configure the "Start/Shutdown order".

  • Start order: Defines the start order priority. E.g. set it to 1 if you start the VM on the first place . ( We use the reverse startup order for shutdown. )
  • Startup delay: After starting this VM continue starting other VM´s or CT´s according to this delay (time in seconds). E.g. set it to 240 if you want to wait 240 seconds before starting other VM´s or CT´s.
  • Shutdown timeout: This timeout is passed to the VM shutdown command. Default "Shutdown timeout" is 60 seconds for Containers and 180 seconds for VMs. On shutdown we use the following command for Vms:
# qm shutdown <vmid> --timeout <timeout>

This first sends an ACPI shutdown request to the VM. Normally The VM shut down normally and we can continue stopping other VMs. But sometime shutdown hangs, for example when ACPI shutdown is not allowed. Then we simply kill the VM after <timeout> seconds. - Dietmar

Note: these GUI settings are currently for KVM VM´s only. if you need to set bootorder for containers you need to set it via CLI (see 'man vzctl').

Example usage

Screen-Startup-order.png
On host start-up, the Windows Server VM with Active Directory and DNS/DHCP server needs to started on first place as others depends on these services.

After 240 seconds, all other VM´s and CT´s should start.

HowTo:

  • Set "Start at boot" to "Yes" for all VM´s and CT´s
  • Set "Start/Shutdown order" according to the screeshot (Start order: 1; Startup delay 240; Shutdown timeout 120)

Task logs

Screen-Startup-order-tasklog.png

All automatic startup and shutdown actions are in the task log, see screenshot.

As the VM startup begins after the startup of the Apache web servers, you can monitor the startup of VM´s on an early stage via GUI.

Video Tutorial

tbd: Proxmox VE Youtube channel

Personal tools
Namespaces

Variants
Actions
Navigation
Virtual Appliances
Sites
Tools