1. I'm sure I'm using the same libvirt and qemu.
2. Here are the files:

Domxml of the VM running with packages from the repository(before attaching 
NIC):

<domain type='kvm' id='10'>
  <name>vm1</name>
  <uuid>54028863-6910-44ac-a843-a61083e65b70</uuid>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu>1</vcpu>
  <cputune>
    <shares>1020</shares>
  </cputune>
  <sysinfo type='smbios'>
    <system>
      <entry name='manufacturer'>Red Hat</entry>
      <entry name='product'>RHEV Hypervisor</entry>
      <entry name='version'>17-1</entry>
      <entry 
name='serial'>53D19F64-D663-A017-8922-003048C440B8_00:30:48:c4:40:b8</entry>
      <entry name='uuid'>54028863-6910-44ac-a843-a61083e65b70</entry>
    </system>
  </sysinfo>
  <os>
    <type arch='x86_64' machine='pc-0.14'>hvm</type>
    <smbios mode='sysinfo'/>
  </os>
  <features>
    <acpi/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>Conroe</model>
    <topology sockets='1' cores='1' threads='1'/>
  </cpu>
  <clock offset='variable' adjustment='0' basis='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-kvm</emulator>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source startupPolicy='optional'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <serial></serial>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <disk type='file' device='disk' snapshot='no'>
      <driver name='qemu' type='raw' cache='none' error_policy='stop' 
io='threads'/>
      <source 
file='/rhev/data-center/3ade04e6-2ce0-46c4-94f9-8af8f3e8aff2/9d07cb97-50d5-499b-90d7-b33673aa6de2/images/ae1866ba-6d87-4851-8a25-bd107a355edd/4f4fd109-0922-461c-8096-a8deb878e1f6'/>
      <target dev='vda' bus='virtio'/>
      <serial>ae1866ba-6d87-4851-8a25-bd107a355edd</serial>
      <boot order='1'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' 
function='0x0'/>
    </disk>
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x2'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' 
function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='00:1a:4a:1e:31:00'/>
      <source bridge='ovirtmgmt'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' 
function='0x0'/>
    </interface>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='virtio' port='0'/>
      <alias name='console0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' 
path='/var/lib/libvirt/qemu/channels/vm1.com.redhat.rhevm.vdsm'/>
      <target type='virtio' name='com.redhat.rhevm.vdsm'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <alias name='channel1'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>
    </channel>
    <input type='mouse' bus='ps2'/>
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes' listen='0' 
keymap='en-us' passwdValidTo='1970-01-01T00:00:01'>
      <listen type='address' address='0'/>
    </graphics>
    <video>
      <model type='qxl' vram='65536' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 
function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' 
function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='none'/>
</domain>

The device attached (extracted from vdsm.log):

<interface type="bridge">
        <mac address="00:1a:4a:1e:31:0e"/>
        <model type="virtio"/>
        <source bridge="ovirtmgmt"/>
</interface>

Domxl After Adding the device(hotplug):

<domain type='kvm' id='10'>
  <name>vm1</name>
  <uuid>54028863-6910-44ac-a843-a61083e65b70</uuid>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu>1</vcpu>
  <cputune>
    <shares>1020</shares>
  </cputune>
  <sysinfo type='smbios'>
    <system>
      <entry name='manufacturer'>Red Hat</entry>
      <entry name='product'>RHEV Hypervisor</entry>
      <entry name='version'>17-1</entry>
      <entry 
name='serial'>53D19F64-D663-A017-8922-003048C440B8_00:30:48:c4:40:b8</entry>
      <entry name='uuid'>54028863-6910-44ac-a843-a61083e65b70</entry>
    </system>
  </sysinfo>
  <os>
    <type arch='x86_64' machine='pc-0.14'>hvm</type>
    <smbios mode='sysinfo'/>
  </os>
  <features>
    <acpi/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>Conroe</model>
    <topology sockets='1' cores='1' threads='1'/>
  </cpu>
  <clock offset='variable' adjustment='0' basis='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-kvm</emulator>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source startupPolicy='optional'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <serial></serial>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <disk type='file' device='disk' snapshot='no'>
      <driver name='qemu' type='raw' cache='none' error_policy='stop' 
io='threads'/>
      <source 
file='/rhev/data-center/3ade04e6-2ce0-46c4-94f9-8af8f3e8aff2/9d07cb97-50d5-499b-90d7-b33673aa6de2/images/ae1866ba-6d87-4851-8a25-bd107a355edd/4f4fd109-0922-461c-8096-a8deb878e1f6'/>
      <target dev='vda' bus='virtio'/>
      <serial>ae1866ba-6d87-4851-8a25-bd107a355edd</serial>
      <boot order='1'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' 
function='0x0'/>
    </disk>
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x2'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' 
function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='00:1a:4a:1e:31:00'/>
      <source bridge='ovirtmgmt'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' 
function='0x0'/>
    </interface>
    <interface type='bridge'>
      <mac address='00:1a:4a:1e:31:0e'/>
      <source bridge='ovirtmgmt'/>
      <target dev='vnet1'/>
      <model type='virtio'/>
      <alias name='net1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' 
function='0x0'/>
    </interface>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='virtio' port='0'/>
      <alias name='console0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' 
path='/var/lib/libvirt/qemu/channels/vm1.com.redhat.rhevm.vdsm'/>
      <target type='virtio' name='com.redhat.rhevm.vdsm'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <alias name='channel1'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>
    </channel>
    <input type='mouse' bus='ps2'/>
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes' listen='0' 
keymap='en-us' passwdValidTo='1970-01-01T00:00:01'>
      <listen type='address' address='0'/>
    </graphics>
    <video>
      <model type='qxl' vram='65536' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 
function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' 
function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='none'/>
</domain>

VM domxml when running vdsm from git (before trying to attach a NIC):

<domain type='kvm' id='11'>
  <name>vm1</name>
  <uuid>54028863-6910-44ac-a843-a61083e65b70</uuid>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu>1</vcpu>
  <cputune>
    <shares>1020</shares>
  </cputune>
  <sysinfo type='smbios'>
    <system>
      <entry name='manufacturer'>Red Hat</entry>
      <entry name='product'>RHEV Hypervisor</entry>
      <entry name='version'>17-1</entry>
      <entry 
name='serial'>53D19F64-D663-A017-8922-003048C440B8_00:30:48:c4:40:b8</entry>
      <entry name='uuid'>54028863-6910-44ac-a843-a61083e65b70</entry>
    </system>
  </sysinfo>
  <os>
    <type arch='x86_64' machine='pc-0.14'>hvm</type>
    <smbios mode='sysinfo'/>
  </os>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>Conroe</model>
    <topology sockets='1' cores='1' threads='1'/>
  </cpu>
  <clock offset='variable' adjustment='0' basis='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-kvm</emulator>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source startupPolicy='optional'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <serial></serial>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <disk type='file' device='disk' snapshot='no'>
      <driver name='qemu' type='raw' cache='none' error_policy='stop' 
io='threads'/>
      <source 
file='/rhev/data-center/3ade04e6-2ce0-46c4-94f9-8af8f3e8aff2/9d07cb97-50d5-499b-90d7-b33673aa6de2/images/ae1866ba-6d87-4851-8a25-bd107a355edd/4f4fd109-0922-461c-8096-a8deb878e1f6'/>
      <target dev='vda' bus='virtio'/>
      <serial>ae1866ba-6d87-4851-8a25-bd107a355edd</serial>
      <boot order='1'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' 
function='0x0'/>
    </disk>
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x2'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' 
function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='00:1a:4a:1e:31:00'/>
      <source bridge='ovirtmgmt'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' 
function='0x0'/>
    </interface>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='virtio' port='0'/>
      <alias name='console0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' 
path='/var/lib/libvirt/qemu/channels/vm1.com.redhat.rhevm.vdsm'/>
      <target type='virtio' name='com.redhat.rhevm.vdsm'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <channel type='unix'>
      <source mode='bind' 
path='/var/lib/libvirt/qemu/channels/vm1.org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <alias name='channel1'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>
    </channel>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <alias name='channel2'/>
      <address type='virtio-serial' controller='0' bus='0' port='3'/>
    </channel>
    <input type='mouse' bus='ps2'/>
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes' listen='0' 
keymap='en-us' passwdValidTo='1970-01-01T00:00:01'>
      <listen type='address' address='0'/>
    </graphics>
    <video>
      <model type='qxl' vram='65536' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 
function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' 
function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='none'/>
</domain>

Device XML (Extracted from vdsm.log):

<interface type="bridge">
        <mac address="00:1a:4a:1e:31:0f"/>
        <model type="virtio"/>
        <source bridge="ovirtmgmt"/>
</interface>

Hope it helps,
Itzik

-----Original Message-----
From: Dan Kenigsberg [mailto:dan...@redhat.com] 
Sent: יום ה 16 אוגוסט 2012 11:07
To: Itzik Brown
Cc: vdsm-devel@lists.fedorahosted.org
Subject: Re: [vdsm] Problem hotplugging an Interface

On Wed, Aug 15, 2012 at 10:03:44AM +0000, Itzik Brown wrote:
> Hi,
> 
> I installed vdsm latest git version.
> When trying to hotplug a new NIC the operation fails.
> 
> Here are some lines from vdsmd.log
> 
> Thread-480::DEBUG::2012-08-15 
> 11:50:52,150::libvirtvm::1398::vm.Vm::(hotplugNic) 
> vmId=`54028863-6910-44ac-a843-a61083e65b70`::Hotplug NIC xml: <interface 
> type="bridge">
>         <mac address="00:1a:4a:1e:31:0c"/>
>         <model type="virtio"/>
>         <source bridge="ovirtmgmt"/>
> </interface>
> 
> Thread-480::ERROR::2012-08-15 
> 11:50:52,297::libvirtvm::1403::vm.Vm::(hotplugNic) 
> vmId=`54028863-6910-44ac-a843-a61083e65b70`::Hotplug failed Traceback (most 
> recent call last):
>   File "/usr/share/vdsm/libvirtvm.py", line 1401, in hotplugNic
>     self._dom.attachDevice(nicXml)
>   File "/usr/share/vdsm/libvirtvm.py", line 487, in f
>     ret = attr(*args, **kwargs)
>   File "/usr/lib64/python2.7/site-packages/vdsm/libvirtconnection.py", line 
> 82, in wrapper
>     ret = f(*args, **kwargs)
>   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 400, in 
> attachDevice
>     if ret == -1: raise libvirtError ('virDomainAttachDevice() 
> failed', dom=self)
> libvirtError: internal error unable to execute QEMU command 
> 'device_add': Bus 'pci.0' does not support hotplugging
> 
> OS: Fedora17
> VDSM Packages: vdsm-4.10.0-0.313.git8bedc7e.fc17.x86_64 
> vdsm-xmlrpc-4.10.0-0.313.git8bedc7e.fc17.noarch 
> vdsm-python-4.10.0-0.313.git8bedc7e.fc17.x86_64
> Libvirt: libvirt-0.9.11.4-3.fc17.x86_64
> QEMU: qemu-common-1.0.1-1.fc17.x86_64
> 
> Trying to attach the NIC using virsh fails as well:
> 
> virsh -c qemu+tcp://localhost/system attach-device vm1 --file 
> /tmp/1.xml
> error: Failed to attach device from /tmp/1.xml
> error: internal error unable to execute QEMU command 'device_add': Bus 
> 'pci.0' does not support hotplugging
> 
> 
> When running with VDSM from ovirt repository with the following packages the 
> hotplug of the NIC works:
> vdsm-xmlrpc-4.10.0-6.fc17.noarch
> vdsm-4.10.0-6.fc17.x86_64
> vdsm-python-4.10.0-6.fc17.x86_64

Excuse me for doubting this report, but are you perfectly sure that you are 
using the same qemu and libvirt with this version of vdsm?

Could you post here the domxml and the device xml produced by the two versions 
of vdsm? I would like to hunt down the differences.
_______________________________________________
vdsm-devel mailing list
vdsm-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-devel

Reply via email to