Ask Your Question
3

Start VMs after reboot compute node

asked 2015-05-14 08:51:23 -0500

eonqee gravatar image

updated 2015-05-15 05:57:34 -0500

SGPJ gravatar image

After reboot compte node VMs don't start and I have to manually start VMs. On the compute node /etc/nova/nova.conf:

resume_guests_state_on_host_boot=true

What do I need to make the VMs to start automatically?

After rebooting: /var/log/nova/compute.log:

2015-05-15 13:37:33.027 2529 WARNING nova.compute.manager [-] [instance: 1ffd4bdb-0c92-4b6c-8781-a42d311bf0b3] Instance is paused unexpectedly. Ignore.
2015-05-15 13:37:36.216 2529 WARNING nova.compute.manager [-] [instance: 1ffd4bdb-0c92-4b6c-8781-a42d311bf0b3] Instance shutdown by itself. Calling the stop API.

/var/log/libvirt/libvirtd.log:

2015-05-15 13:37:35.584+0000: 2071: error : virNWFilterDHCPSnoopEnd:2131 : internal error ifname "vnet0" not in key map
2015-05-15 13:37:36.794+0000: 2066: error : virNetSocketReadWire:1194 : End of file while reading data: Input/output error

/var/log/libvirt/qemu/instance-000000ce.log:

2015-05-15 13:37:35.584+0000: shutting down
qemu: terminating on signal 15 from pid 2066
2015-05-15 13:38:24.489+0000: shutting down
edit retag flag offensive close merge delete

Comments

I think that it is the correct parameter to set on nova.conf file on compute nodes in order to get that behavior. Do you see any ERROR in your nova log files?

Antonio G. gravatar imageAntonio G. ( 2015-05-15 05:13:32 -0500 )edit

Yes. I added in the first message

eonqee gravatar imageeonqee ( 2015-05-15 05:44:45 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
1

answered 2015-10-30 06:34:34 -0500

Peter Jenkins gravatar image

We had this exact issue and solved it by using the libvirt-guests service to cleanly shutdown the vms, but nova-compute to start them again. Relying on libvirt-guests is no good because when it tries to restart the vm, the network isn't configured correctly (at least in our case, where we use the Neutron ML2 plugin, the network bridges were not configured at this point in the boot process).

Configure libvirt-guests to shutdown vms, but not start them at boot. Edit /etc/sysconfig/libvirt-guests

# action taken on host boot
# - start   all guests which were running on shutdown are started on boot
#           regardless on their autostart settings
# - ignore  libvirt-guests init script won't start any guest on boot, however,
#           guests marked as autostart will still be automatically started by
#           libvirtd
#ON_BOOT=start
ON_BOOT=ignore

And:

# action taken on host shutdown
# - suspend   all running guests are suspended using virsh managedsave
# - shutdown  all running guests are asked to shutdown. Please be careful with
#             this settings since there is no way to distinguish between a
#             guest which is stuck or ignores shutdown requests and a guest
#             which just needs a long time to shutdown. When setting
#             ON_SHUTDOWN=shutdown, you must also set SHUTDOWN_TIMEOUT to a
#             value suitable for your guests.
#ON_SHUTDOWN=suspend
ON_SHUTDOWN=shutdown

You can also configure timings and whether to shutdown in parallel. Make sure the libvirt-guests service is enabled and running:

systemctl enable libvirt-guests
systemctl status libvirt-guests

Then make sure you've set nova-compute as described in this question (resume_guests_state_on_host_boot=true). Enable and restart nova-compute and you are ready for testing.

In our testing we found this worked well for all vm states, except 'paused', which resulted in the paused vm's being shutdown. We very rarely see users pausing our VMs so we decided to live with this bug.

edit flag offensive delete link more
1

answered 2015-05-17 23:03:51 -0500

sunnyarora gravatar image

[That option only resumes guests that were running before the host rebooted. Rest all states are ignored by implementation.] [Answered here](https://ask.openstack.org/en/question/5100/after-reboot-doesnt-run-guest/) Also, If you set this flag, whenever you restart the nova-compute service, the running instances on that same node also reboot.

Alternate Option : For autostart you need to use available KVM funtionality. You need Set the 'autostart' flag so the vm/domain is started upon boot. you can the status via 'virsh net-list'. Please also make sure /etc/init.d/libvirtd service is stared on boot:

virsh autostart vmname  
virsh net-list     
chkconfig libvirtd on
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2015-05-14 08:51:23 -0500

Seen: 8,907 times

Last updated: Oct 30 '15