libvirt fails to start correctly because LVM is not ready
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libvirt (Ubuntu) |
Expired
|
High
|
Unassigned | ||
udev (Ubuntu) |
Expired
|
Undecided
|
Unassigned |
Bug Description
Some times, one of the KVM guest failed to start. I've 3 guest, two started OK and one failed (the two times the same has failed). After rebooting the host two times, the KVM guest started OK, but this is a server and found too risky this behavior. The host server is running "Ubuntu 11.04 Server 64bits" and libvirt 0.8.8-1ubuntu6.5
The two times that failed, I've found this on syslog:
error : virSecurityDACS
kernel: [ 200.354543] type=1400 audit(132193214
kernel: [ 200.692255] type=1400 audit(132193214
libvirtd: 00:22:21.424: 2539: error : virSecurityDACR
libvirtd: 00:22:21.707: 2539: error : qemuAutostartDo
The LVM device is on a software raid. Maybe this is taking too long to come up?
FYI, running "aa-status" (after the reboots) gives me:
apparmor module is loaded.
9 profiles are loaded.
9 profiles are in enforce mode.
/sbin/dhclient
/usr/
/usr/
/usr/
/usr/
/usr/
libvirt-
libvirt-
libvirt-
0 profiles are in complain mode.
4 processes have profiles defined.
4 processes are in enforce mode :
/usr/
libvirt-
libvirt-
libvirt-
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.
Changed in libvirt (Ubuntu): | |
importance: | Undecided → High |
summary: |
- KVM guest fails to autostart sometimes with - virSecurityDACRestoreSecurityFileLabel error + libvirt fails to start correctly because LVM is not ready |
Changed in udev (Ubuntu): | |
status: | Incomplete → Confirmed |
Changed in libvirt (Ubuntu): | |
status: | Incomplete → New |
Changed in udev (Ubuntu): | |
status: | Incomplete → New |
Changed in libvirt (Ubuntu): | |
status: | New → Incomplete |
Changed in udev (Ubuntu): | |
status: | New → Incomplete |
Thanks for submitting this bug. I'm marking it high priority as it fits 'severe impact on a small number of users'.
The problem appears to be that the logical volume is slow in coming up, such that libvirt starts before the udev creates its device node. Working around this in your particular case should be pretty easy, but a general fix will be harder.
To work around it in your case, please try adding the following to your /etc/init/ libvirt- bin.conf file, at the end of the 'pre-start script' section:
while [ ! -e /dev/vg_ default/ lv_robot- pv0 ]; do
sleep 1s
done
So, for instance, the pre-start script section would probably become:
pre-start script libvirt- bin ] && . /etc/default/ libvirt- bin libvirtd. pid libvirt- upstart libvirt- upstart libvirt- upstart libvirt- upstart default/ lv_robot- pv0 ]; do
[ -r /etc/default/
[ ! "x$start_libvirtd" = "xyes" ] && { stop; exit 0; }
mkdir -p /var/run/libvirt
# Clean up a pidfile that might be left around
rm -f /var/run/
date >> /var/log/
echo $$ >> /var/log/
cat /proc/self/cmdline >> /var/log/
cat /proc/self/cgroup >> /var/log/
while [ ! -e /dev/vg_
sleep 1s
done
end script
Please let us know if that does not work around your problem for now.