cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rohit Yadav <>
Subject Re: libvirt exception
Date Fri, 10 Jul 2015 19:16:30 GMT
Wei - is this issue fixed on 4.5/master?

On 11-May-2015, at 12:32 pm, Wei ZHOU <<>>

Hi Mike,

Please apply the following patch to cloudstack, and copy the file
agent/bindir/ to repace /etc/libvirt/hooks/qemu on your


diff --git a/agent/bindir/ b/agent/bindir/
index 7bf9634..a895280 100755
--- a/agent/bindir/
+++ b/agent/bindir/
@@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
import sys
+import re
from xml.dom.minidom import parse
from cloudutils.configFileOps import configFileOps
from cloudutils.networkConfig import networkConfig
@@ -24,21 +25,29 @@ def isOldStyleBridge(brName):
       return True
       return False
+def isNewStyleBridge(brName):
+    if re.match(r"br(\w+)-(\d+)", brName) == None:
+       return False
+    else:
+       return True
def getGuestNetworkDevice():
    netlib = networkConfig()
    cfo = configFileOps("/etc/cloudstack/agent/")
    guestDev = cfo.getEntry("")
    enslavedDev = netlib.getEnslavedDev(guestDev, 1)
-    return enslavedDev
+    return enslavedDev.split(".")[0]
def handleMigrateBegin():
        domain = parse(sys.stdin)
        for interface in domain.getElementsByTagName("interface"):
            source = interface.getElementsByTagName("source")[0]
            bridge = source.getAttribute("bridge")
-            if not isOldStyleBridge(bridge):
+            if isOldStyleBridge(bridge):
+                vlanId = bridge.replace("cloudVirBr","")
+            elif isNewStyleBridge(bridge):
+                vlanId = re.sub(r"br(\w+)-","",bridge)
+            else:
-            vlanId = bridge.replace("cloudVirBr","")
            phyDev = getGuestNetworkDevice()
            newBrName="br" + phyDev + "-" + vlanId
            source.setAttribute("bridge", newBrName)


Kind regards,

2015-05-10 7:35 GMT+02:00 Mike C <<>>:

On 2015-05-08 20:07, Marcus wrote:

Can you confirm that those bridges and bond devices exist prior to
attempting migration, and that the VMs are attached to them and work?
Perhaps a 'brctl show' and 'virsh dumpxml'. Those look like they should be
cloudstack-generated guest network bridges and libvirt is complaining they
don't exist

Everything as far as I can tell is working minus this migration. I have a
few virtual routers running on this machine and VMs, each environment
running on the box seems to be doing working just fine. The base mgmtbr0,
cloudbr0, cloudbr1 all come up at boot prior to CloudStack and are working.

Command output is below.

Also: the router seems to have been restarted and was allocated on the
machine I was trying to migrate it to. Trying to migrate it back resulted
in the same error message.

-- Mike

# brctl show
bridge name     bridge id               STP enabled     interfaces
breth0-1209             8000.6805ca095d7f       no              eth0.1209
breth0-1221             8000.6805ca095d7f       no              eth0.1221
cloud0          8000.fe00a9fe0380       no              vnet1
cloudbr0                8000.6805ca095d7f       no              eth0.1100
cloudbr1                8000.6805ca095d7f       no              eth0.1200
mgmtbr0         8000.002564b522ef       no              eth1
virbr0          8000.000000000000       yes

# virsh dumpxml r-93-XML
<domain type='kvm' id='18'>
 <description>Debian GNU/Linux 7(64-bit)</description>
 <memory unit='KiB'>262144</memory>
 <currentMemory unit='KiB'>262144</currentMemory>
 <vcpu placement='static'>1</vcpu>
   <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
   <boot dev='cdrom'/>
   <boot dev='hd'/>
 <clock offset='utc'/>
   <disk type='file' device='disk'>
     <driver name='qemu' type='qcow2' cache='none'/>
     <target dev='hda' bus='ide'/>
     <alias name='ide0-0-0'/>
     <address type='drive' controller='0' bus='0' target='0' unit='0'/>
   <disk type='file' device='cdrom'>
     <driver name='qemu' type='raw' cache='none'/>
     <source file='/usr/share/cloudstack-common/vms/systemvm.iso'/>
     <target dev='hdc' bus='ide'/>
     <alias name='ide0-1-0'/>
     <address type='drive' controller='0' bus='1' target='0' unit='0'/>
   <controller type='usb' index='0'>
     <alias name='usb0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
   <controller type='pci' index='0' model='pci-root'>
     <alias name='pci.0'/>
   <controller type='ide' index='0'>
     <alias name='ide0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
   <controller type='virtio-serial' index='0'>
     <alias name='virtio-serial0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x06'
   <interface type='bridge'>
     <mac address='02:00:6b:5b:00:03'/>
     <source bridge='breth0-1221'/>
       <inbound average='25600' peak='25600'/>
       <outbound average='25600' peak='25600'/>
     <target dev='vnet0'/>
     <model type='e1000'/>
     <alias name='net0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
   <interface type='bridge'>
     <mac address='0e:00:a9:fe:03:80'/>
     <source bridge='cloud0'/>
     <target dev='vnet1'/>
     <model type='e1000'/>
     <alias name='net1'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x04'
   <interface type='bridge'>
     <mac address='06:13:ca:00:00:36'/>
     <source bridge='cloudbr0'/>
       <inbound average='25600' peak='25600'/>
       <outbound average='25600' peak='25600'/>
     <target dev='vnet2'/>
     <model type='e1000'/>
     <alias name='net2'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
   <serial type='pty'>
     <source path='/dev/pts/0'/>
     <target port='0'/>
     <alias name='serial0'/>
   <console type='pty' tty='/dev/pts/0'>
     <source path='/dev/pts/0'/>
     <target type='serial' port='0'/>
     <alias name='serial0'/>
   <channel type='unix'>
     <source mode='bind' path='/var/lib/libvirt/qemu/r-93-VM.agent'/>
     <target type='virtio' name='r-93-VM.vport'/>
     <alias name='channel0'/>
     <address type='virtio-serial' controller='0' bus='0' port='1'/>
   <input type='tablet' bus='usb'>
     <alias name='input0'/>
   <input type='mouse' bus='ps2'/>
   <input type='keyboard' bus='ps2'/>
   <graphics type='vnc' port='5900' autoport='yes' listen=''>
     <listen type='address' address=''/>
     <model type='cirrus' vram='9216' heads='1'/>
     <alias name='video0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
   <memballoon model='none'>
     <alias name='balloon0'/>
 <seclabel type='none'/>

Rohit Yadav
Software Architect, ShapeBlue


M. +91 88 262 30892 |<>
Blog:<> | Twitter: @_bhaisaab

Find out more about ShapeBlue and our range of CloudStack related services

IaaS Cloud Design & Build<>
CSForge - rapid IaaS deployment framework<>
CloudStack Consulting<>
CloudStack Software Engineering<>
CloudStack Infrastructure Support<>
CloudStack Bootcamp Training Courses<>

This email and any attachments to it may be confidential and are intended solely for the use
of the individual to whom it is addressed. Any views or opinions expressed are solely those
of the author and do not necessarily represent those of Shape Blue Ltd or related companies.
If you are not the intended recipient of this email, you must neither take any action based
upon its contents, nor copy or show it to anyone. Please contact the sender if you believe
you have received this email in error. Shape Blue Ltd is a company incorporated in England
& Wales. ShapeBlue Services India LLP is a company incorporated in India and is operated
under license from Shape Blue Ltd. Shape Blue Brasil Consultoria Ltda is a company incorporated
in Brasil and is operated under license from Shape Blue Ltd. ShapeBlue SA Pty Ltd is a company
registered by The Republic of South Africa and is traded under license from Shape Blue Ltd.
ShapeBlue is a registered trademark.

  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message