Unable to start instances, empty /etc/machine-id file.

Bug #1413293 reported by James Page
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nova (Ubuntu)
Fix Released
High
Unassigned

Bug Description

This file is present but empty on a vivid cloud image.

Log:

2015-01-21 16:29:16.841 27359 INFO nova.scheduler.client.report [-] Compute_service record updated for ('juju-jp-machine-14', 'juju-jp-machine-14.openstacklocal')
2015-01-21 16:29:17.153 27359 INFO nova.virt.libvirt.driver [-] [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] Creating image
2015-01-21 16:29:17.316 27359 INFO nova.virt.disk.vfs.api [-] Unable to import guestfs, falling back to VFSLocalFS
2015-01-21 16:29:17.553 27359 ERROR nova.compute.manager [-] [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] Instance failed to spawn
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] Traceback (most recent call last):
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2297, in _build_resources
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] yield resources
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2167, in _build_and_run_instance
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] flavor=flavor)
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 2385, in spawn
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] flavor=flavor)
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 4013, in _get_guest_xml
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] context, flavor=flavor)
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 3834, in _get_guest_config
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] guest.sysinfo = self._get_guest_config_sysinfo(instance)
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 3316, in _get_guest_config_sysinfo
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] sysinfo.system_serial = self._sysinfo_serial_func()
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 3305, in _get_host_sysinfo_serial_auto
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] return self._get_host_sysinfo_serial_os()
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 3301, in _get_host_sysinfo_serial_os
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] return str(uuid.UUID(f.read().split()[0]))
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] IndexError: list index out of range
2015-01-21 16:29:17.553 27359 TRACE nova.compute.manager [instance: 829fbae9-1152-41d2-80e7-d72dc4588701]
2015-01-21 16:29:17.555 27359 AUDIT nova.compute.manager [req-40a2a66d-6ef0-4896-80ec-2bf621ab198a None] [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] Terminating instance
2015-01-21 16:29:17.566 27359 WARNING nova.virt.libvirt.driver [-] [instance: 829fbae9-1152-41d2-80e7-d72dc4588701] During wait destroy, instance disappeared.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: nova-compute 1:2015.1~b1-0ubuntu5
ProcVersionSignature: User Name 3.18.0-9.10-generic 3.18.2
Uname: Linux 3.18.0-9-generic x86_64
ApportVersion: 2.15.1-0ubuntu2
Architecture: amd64
Date: Wed Jan 21 16:31:17 2015
Ec2AMI: ami-000000a4
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.medium
Ec2Kernel: aki-00000002
Ec2Ramdisk: ari-00000002
NovaConf: Error: [Errno 13] Permission denied: '/etc/nova/nova.conf'
PackageArchitecture: all
SourcePackage: nova
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.nova.rootwrap.d.compute.filters: [deleted]

Revision history for this message
James Page (james-page) wrote :
Revision history for this message
James Page (james-page) wrote :

Nova will use this file if present; however its empty on a stock vivid cloud-image.

Dan Watkins (oddbloke)
Changed in nova (Ubuntu):
assignee: nobody → Daniel Watkins (daniel-thewatkins)
James Page (james-page)
Changed in nova (Ubuntu):
importance: Undecided → High
status: New → Triaged
Revision history for this message
Dan Watkins (oddbloke) wrote :

This problem (should) disappear with systemd; it takes care of populating /etc/machine-id on first boot, though it does need the file to exist and be empty[0].

So we should do one (or more) of:
 - teach nova that an empty /etc/machine-id is equivalent to a missing one,
 - introduce an Upstart job which will populate /etc/machine-id on boot, or
 - wait.

[0] systemd needs /etc/machine-id to exist if /etc is read-only, so it can mount (a temporary) /run/machine-id over it. Once /etc becomes writable, the temporary file is made persistent.

Revision history for this message
Dan Watkins (oddbloke) wrote :

I'm unassigning myself; this isn't really a cloud image problem so much as it is either a nova problem or a general Ubuntu problem; I'm not best placed to solve either of these.

Changed in nova (Ubuntu):
assignee: Daniel Watkins (daniel-thewatkins) → nobody
Revision history for this message
Andrea Rosa (andrea-rosa-m) wrote :

I submitted a patch to nova to fix this issue: https://review.openstack.org/202640

Revision history for this message
Andrea Rosa (andrea-rosa-m) wrote :

The patch has been merged in the nova code. Please note that the patch implements the logic suggested in the comment #3:
if the file is present but empty nova will consider it as a missing file, then it raises an exception.

Revision history for this message
Chuck Short (zulcss) wrote :

This has been fixed in newton.

Changed in nova (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.