'started libvirt-bin' event occurs before libvirt networks available
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libvirt (Ubuntu) |
Triaged
|
Medium
|
Unassigned |
Bug Description
I was trying to create an event that occurred on libvirt coming up:
$ cat /etc/init/
description "restart dhcpd"
start on started libvirt-bin
task
script
sleep 5 # hack, let the interfaces comeup
start maas-dhcp-server
end script
Specifically I was looking for the availability of a given network in libvirt (see bug 1056921), but 'started' would have been fine. The problem was that libvirt daemonizes (and goes to 'started') before all of its 'auto' created networks are up.
Basically, given:
BRIDGE="smbr0"
cat > libvirt-$BRIDGE.xml <<EOF
<network>
<name>
<forward mode='nat'/>
<bridge name='$BRIDGE' stp='off' delay='0' />
<ip address=
</ip>
</network>
EOF
sg libvirtd -c "virsh -c qemu:///system net-define libvirt-
sg libvirtd -c "virsh -c qemu:///system net-autostart $BRIDGE"
sg libvirtd -c "virsh -c qemu:///system net-start $BRIDGE"
I'm suggesting that 'started libvirt-bin' should mean that $BRIDGE is up.
ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: libvirt-bin 0.9.13-0ubuntu10
ProcVersionSign
Uname: Linux 3.5.0-15-generic x86_64
ApportVersion: 2.5.2-0ubuntu4
Architecture: amd64
Date: Wed Sep 26 14:57:54 2012
Ec2AMI: ami-00000153
Ec2AMIManifest: FIXME
Ec2Availability
Ec2InstanceType: m1.small
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
ProcEnviron:
TERM=screen
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: libvirt
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in libvirt (Ubuntu): | |
status: | New → Triaged |
Thanks for this bug report.
There was a session at the last UDS about how upstart could detect service readiness. I'm going to temporarily assign this bug to jodh to ask for his feedback on how this would best be done, since AIUI upstart simply says "libvirt has started running', and I can't recall what was the answer to whether or how it could detect 'libvirt is ready'. I do recall that the idea of upstart statements saying "it is ready when port xyz is up' was in the end rejected.