Empty /etc/machine-id file fails instance creation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Confirmed
|
Low
|
Unassigned |
Bug Description
Description
===========
If the /etc/machine-id file is present but empty for some reason, instance creation fails if the sysinfo_serial config option is set to 'auto' (default). The _get_host_
However, if the sysinfo_serial config option is set to 'auto', the driver only checks for the presence of file when choosing to report 'os' serial. If the file is present but empty, this throws NovaException instead of falling back to reporting 'hardware' serial instead.
Filing this bug to treat empty and missing file as the same in _get_host_
Steps to reproduce
==================
1. Empty the contents of /etc/machine-id file on a KVM host.
2. Set sysinfo_serial option in nova.conf to 'auto' (default).
3. Try to create an instance.
Expected result
===============
Instance creation should be successful.
Actual result
=============
Instance creation failed with error:
NovaException: Unable to get host UUID: /etc/machine-id is empty
Environment
===========
Openstack Liberty
Hypervisor - Libvirt + KVM
Storage - Local disk
Networking - Nova-network
Changed in nova: | |
assignee: | nobody → Pooja Ghumre (pooja-9) |
Changed in nova: | |
assignee: | Pooja Ghumre (pooja-9) → Jordan Pittier (jordan-pittier) |
Changed in nova: | |
assignee: | Jordan Pittier (jordan-pittier) → Matt Riedemann (mriedem) |
Changed in nova: | |
status: | In Progress → Confirmed |
assignee: | Matt Riedemann (mriedem) → nobody |
Posting error stacktrace for reference:
2016-05-16 19:57:09.732 ^[[01;31mERROR nova.compute. manager [req-4e5323f2- 8f1b-4471- b166-160043a4bc 71 <email address hidden> service^[[01;31m] [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] ^[[01;31mInstance failed to spawn manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] Traceback (most recent call last): manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] File "nova/compute/ manager. py", line 2383, in _build_resources manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] yield resources manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] File "nova/compute/ manager. py", line 2237, in _build_ and_run_ instance manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] block_device_ info=block_ device_ info) manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] File "nova/virt/ libvirt/ driver. py", line 2648, in spawn manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] write_to_disk=True) manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] File "nova/virt/ libvirt/ driver. py", line 4608, in _get_guest_xml manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] context) manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] File "nova/virt/ libvirt/ driver. py", line 4457, in _get_guest_config manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] root_device_name) manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] File "nova/virt/ libvirt/ driver. py", line 4280, in _configure_ guest_by_ virt_type manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] guest.sysinfo = self._get_ guest_config_ sysinfo( instance) manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] File "nova/virt/ libvirt/ driver. py", line 3673, in _get_guest_ config_ sysinfo manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] sysinfo. system_ serial = self._sysinfo_ serial_ func() manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] File "nova/virt/ libvirt/ driver. py", line 3662, in _get_host_ sysinfo_ serial_ auto manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] return self._get_ host_sysinfo_ serial_ os() manager [instance: 612120e9- 5b3f-44a7- 9e7e-2194b87dc4 59] File "nova/virt/ libvirt/ driver. py", line 3656, in _get_host_ sysinfo_ serial_ os
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[[01;31m2016-05-16 19:57:09.732 TRACE nova.compute.
^[...