Dan Kenigsberg has uploaded a new change for review.
Change subject: Avoid re-setting <boot> element when updating nic properties ......................................................................
Avoid re-setting <boot> element when updating nic properties
Mentioning <boot> in the vnicxml passed to updateDevice explodes for libvirt < 19.el6.
Change-Id: Ib81e1476e3ed31c9b07738cad1e45887f858d842 Signed-off-by: Dan Kenigsberg danken@redhat.com --- M vdsm/vm.py 1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/96/18796/1
diff --git a/vdsm/vm.py b/vdsm/vm.py index 4e2a696..fc8d3e9 100644 --- a/vdsm/vm.py +++ b/vdsm/vm.py @@ -3089,6 +3089,8 @@ link = xml.dom.minidom.Element('link') vnicXML.appendChildWithArgs(link) link.setAttribute('state', linkValue) + # drop <boot> element from vnicXML until libvirt rhbz#895294 is solved + vnicXML.firstChild.removeChild(vnicXML.getElementsByTagName('boot')[0]) vnicStrXML = vnicXML.toprettyxml(encoding='utf-8') try: try:
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Avoid re-setting <boot> element when updating nic properties ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/4249/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/3354/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/4170/ : SUCCESS
Antoni Segura Puimedon has posted comments on this change.
Change subject: Avoid re-setting <boot> element when updating nic properties ......................................................................
Patch Set 1: Code-Review+1
I'd rather have this fixed by a libvirt backport. But I'm not opposed to having the fix this patch makes while the libvirt backport does not happen.
Petr Šebek has posted comments on this change.
Change subject: Avoid re-setting <boot> element when updating nic properties ......................................................................
Patch Set 1: Verified-1
When I tried to verify it there were this exception:
File "/usr/share/vdsm/vm.py", line 3093, in setLinkAndNetwork vnicXML.firstChild.removeChild(vnicXML.getElementsByTagName('boot')[0]) File "/usr/lib64/python2.6/xml/dom/minidom.py", line 164, in removeChild raise xml.dom.NotFoundErr() NotFoundErr
After that I tried to change that piece of code to:
try: vnicXML.firstChild.removeChild(vnicXML.getElementsByTagName('boot')[0] except xml.dom.NotFoundErr: pass
It fails with original exception:
libvirtError: this function is not supported by the connection driver: cannot modify network device boot index setting
Petr Šebek has posted comments on this change.
Change subject: Avoid re-setting <boot> element when updating nic properties ......................................................................
Patch Set 1:
So I changed
vnicXML.firstChild.removeChild(vnicXML.getElementsByTagName('boot')[0])
to
vnicXML.removeChild(vnicXML.getElementsByTagName('boot')[0])
And now it deletes 'boot' element:
### BEFORE ### Thread-85::DEBUG::2013-09-03 15:32:37,172::vm::3092::vm.Vm::(setLinkAndNetwork) vmId=`51493dc4-72f8-4aa0-89a2-dde934d5d618`::vnicXML: <interface type="bridge"> <address bus="0x00" domain="0x0000" function="0x0" slot="0x03" type="pci"/> <mac address="00:1a:4a:09:65:18"/> <model type="virtio"/> <source bridge="rhevm"/> <filterref filter="vdsm-no-mac-spoofing"/> <link state="down"/> <boot order="1"/> </interface>
### AFTER ### Thread-85::DEBUG::2013-09-03 15:32:37,174::vm::3096::vm.Vm::(setLinkAndNetwork) vmId=`51493dc4-72f8-4aa0-89a2-dde934d5d618`::vnicXML AFTER DELETION: <interface type="bridge"> <address bus="0x00" domain="0x0000" function="0x0" slot="0x03" type="pci"/> <mac address="00:1a:4a:09:65:18"/> <model type="virtio"/> <source bridge="rhevm"/> <filterref filter="vdsm-no-mac-spoofing"/> <link state="down"/> </interface>
But the original exception still remains which I don't understand:
Thread-85::DEBUG::2013-09-03 15:32:37,177::libvirtconnection::101::libvirtconnection::(wrapper) Unknown libvirterror: ecode: 3 edom: 10 level: 2 message: this function is not supported by the connection driver: cannot modify network device boot index setting Thread-85::DEBUG::2013-09-03 15:32:37,177::vm::3107::vm.Vm::(setLinkAndNetwork) vmId=`51493dc4-72f8-4aa0-89a2-dde934d5d618`::Request failed: <interface type="bridge"> <address bus="0x00" domain="0x0000" function="0x0" slot="0x03" type="pci"/> <mac address="00:1a:4a:09:65:18"/> <model type="virtio"/> <source bridge="rhevm"/> <filterref filter="vdsm-no-mac-spoofing"/> <link state="down"/> </interface> Traceback (most recent call last): File "/usr/share/vdsm/vm.py", line 3102, in setLinkAndNetwork libvirt.VIR_DOMAIN_AFFECT_LIVE) File "/usr/share/vdsm/vm.py", line 824, in f ret = attr(*args, **kwargs) File "/usr/lib64/python2.6/site-packages/vdsm/libvirtconnection.py", line 76, in wrapper ret = f(*args, **kwargs) File "/usr/lib64/python2.6/site-packages/libvirt.py", line 1742, in updateDeviceFlags if ret == -1: raise libvirtError ('virDomainUpdateDeviceFlags() failed', dom=self) libvirtError: this function is not supported by the connection driver: cannot modify network device boot index setting Thread-85::DEBUG::2013-09-03 15:32:37,182::vm::3114::vm.Vm::(setLinkAndNetwork) vmId=`51493dc4-72f8-4aa0-89a2-dde934d5d618`::Rolling back link and net for: net0 Traceback (most recent call last): File "/usr/share/vdsm/vm.py", line 3109, in setLinkAndNetwork raise SetLinkAndNetworkError(e.message) SetLinkAndNetworkError: this function is not supported by the connection driver: cannot modify network device boot index setting Thread-85::DEBUG::2013-09-03 15:32:37,183::libvirtconnection::101::libvirtconnection::(wrapper) Unknown libvirterror: ecode: 3 edom: 10 level: 2 message: this function is not supported by the connection driver: cannot modify network device boot index setting Thread-85::ERROR::2013-09-03 15:32:37,183::BindingXMLRPC::984::vds::(wrapper) libvirt error Traceback (most recent call last): File "/usr/share/vdsm/BindingXMLRPC.py", line 979, in wrapper res = f(*args, **kwargs) File "/usr/share/vdsm/BindingXMLRPC.py", line 284, in vmUpdateDevice return vm.vmUpdateDevice(params) File "/usr/share/vdsm/API.py", line 384, in vmUpdateDevice return v.updateDevice(params) File "/usr/share/vdsm/vm.py", line 3161, in updateDevice return self._updateInterfaceDevice(params) File "/usr/share/vdsm/vm.py", line 3071, in _updateInterfaceDevice custom): File "/usr/lib64/python2.6/contextlib.py", line 16, in __enter__ return self.gen.next() File "/usr/share/vdsm/vm.py", line 3116, in setLinkAndNetwork libvirt.VIR_DOMAIN_AFFECT_LIVE) File "/usr/share/vdsm/vm.py", line 824, in f ret = attr(*args, **kwargs) File "/usr/lib64/python2.6/site-packages/libvirt.py", line 1742, in updateDeviceFlags if ret == -1: raise libvirtError ('virDomainUpdateDeviceFlags() failed', dom=self) libvirtError: this function is not supported by the connection driver: cannot modify network device boot index setting
Dan Kenigsberg has posted comments on this change.
Change subject: Avoid re-setting <boot> element when updating nic properties ......................................................................
Patch Set 1: Code-Review-1
You are right. libvirt-0.10.2-18.el6_4.9.x86_64 is unnerved by the fact that we do not pass the <boot> element. updateDevice still explodes.
2013-09-03 13:32:37.183+0000: 2349: debug : virDomainUpdateDeviceFlags:9825 : dom=0x7f9094083830, (VM: name=psebek-vm1, uuid=51493dc4-72f8-4aa0-89a2-dde934d5d618), xml=<interface type="bridge"><address bus="0x00" domain="0x0000" function="0x0" slot="0x03" type="pci"/><mac address="00:1a:4a:09:65:18"/><model type="virtio"/><source bridge="rhevm"/><filterref filter="vdsm-no-mac-spoofing"/><link state="down"/></interface>, flags=1 2013-09-03 13:32:37.183+0000: 2349: debug : qemuDomainObjBeginJobInternal:808 : Starting job: modify (async=none) 2013-09-03 13:32:37.183+0000: 2349: error : qemuDomainChangeNet:1487 : this function is not supported by the connection driver: cannot modify network device boot index setting
Dan Kenigsberg has abandoned this change.
Change subject: Avoid re-setting <boot> element when updating nic properties ......................................................................
Abandoned
we'll wait for libvirt Bug 1003934 - vmUpdateDevice fails when nic has boot order set
vdsm-patches@lists.fedorahosted.org