The default configuration of OpenStack Nova compute service does not automatically start Virtual Machines each time the compute node boots or restarts. In this short guide, I’ll show you how to Configure Openstack Nova to automatically start guests that were running before the host rebooted.

openstack list instances running

Login to your Openstack compute node and open Nova configuration file using your favorite file editor. I’ll go with vim.

sudo vim /etc/nova/nova.conf

Add below line under the [DEFAULT] section.

resume_guests_state_on_host_boot = True

This option specifies whether to start guests that were running before the host rebooted.

You have to restart openstack nova service after making the change in the configuration file.

sudo systemctl restart openstack-nova-compute

Option 2: Do it Manually on KVM

You can get the same result by manually turning on VM autostart feature on KVM with the virsh command line tool.

List available domains.

$ virsh  list --all
 Id    Name                           State
 3     instance-0000000d              running
 4     instance-0000000e              running

Get domain information.

$ virsh dominfo instance-0000000d
Id:             3
Name:           instance-0000000d
UUID:           09e738b6-fd1a-4075-a589-b3f38268b52c
OS Type:        hvm
State:          running
CPU(s):         2
CPU time:       339.5s
Max memory:     4194304 KiB
Used memory:    4194304 KiB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: none
Security DOI:   0

$ virsh dominfo 4
Id:             4
Name:           instance-0000000e
UUID:           08df4929-4d9e-4881-9f01-6d89e9862385
OS Type:        hvm
State:          running
CPU(s):         4
CPU time:       336.1s
Max memory:     8388608 KiB
Used memory:    8388608 KiB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: none
Security DOI:   0

You can confirm from the output the Autostart flag is set to disable. To enable it, run:

sudo virsh autostart instance-0000000d
sudo virsh autostart  instance-0000000e

Virtual machine domain ID can be used in-place of a name.

More Openstack articles:

How To Resize OpenStack Instance / Virtual Machine

How To Create OpenStack Cinder Volumes and Attach to a VM Instance/Server on CLI

How To Add RHEL 8 qcow2 Image To OpenStack Glance

OpenStack Deployment on CentOS 7 With Packstack

How To Install and Configure OpenStack Client on Linux

OpenStack Deployment on Ubuntu 18.04 with DevStack

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.


Please enter your comment!
Please enter your name here