Typo: nova/virt/libvirt/libvirt.py --> nova/virt/libvirt/driver.py

Cheers,
Sundar

From: Sundar Nadathur
Sent: Sunday, November 29, 2015 9:59 PM
To: 'openstack-dev@lists.openstack.org'
Subject: Devices in VM that are not in instance XML

Hi,
   I am facing a strange issue where I remove some devices from a VM's xml 
before creating the domain, but both device types are still present in the VM, 
but with a different definition.

Background:
   I am attempting to inject or remove some devices from specific VMs before 
they are brought up. More specifically, I'd like to update the instance's 
domain XML on the compute host before the instance is launched, as part of Nova 
Compute. This is to be done programmatically, not manually.

However, the build_instance hook in Nova compute doesn't quite let one do that. 
In the 'pre' hook, the instance XML is not yet defined. In the post hook, it is 
defined but it already too late because the domain has been created from the 
xml.

What I did:
So, as an experiment, I modified nova/virt/libvirt/libvirt.py, specifically
def spawn(...):
    disk_info = ...
    self._create_image(...)
   xml = self._get_guest_xml(..., write_to_disk=False)
    # -- Modify the xml here and write it to libvirt.xml
    self._create_domain_and_network(context, xml, ...)

Also, I verified in _create_domain, just before:
    domain = self._conn.defineXML(xml)
that the xml is as I intended.

Problem:
But it doesn't work. In this experiment, I am trying to remove the memballoon 
(virtio) device and an USB device from the domain XML. But both show up in the 
VM under lspci after the VM boots up, but with a different definition.

The original XML had:
    <input type="tablet" bus="usb"/>
    <memballoon model="virtio">   <stats period="10"/>   </memballoon>

Both got removed. But 'virsh dumpxml' of the VM shows:
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x2'/>
    </controller>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' 
function='0x0'/>
    </memballoon>

Where are these devices coming from, since they are not present in the 
defineXML that nova.compute.libvirt driver invokes?

Cheers,
Sundar


________________________________

Confidentiality Notice.
This message may contain information that is confidential or otherwise 
protected from disclosure. If you are not the intended recipient, you are 
hereby notified that any use, disclosure, dissemination, distribution, or 
copying of this message, or any attachments, is strictly prohibited. If you 
have received this message in error, please advise the sender by reply e-mail, 
and delete the message and any attachments. Thank you.
__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to