Ask Your Question

how to add feature flag to libvirt.xml

asked 2014-08-22 02:34:08 -0500

alissa gravatar image


I am using Xen + libvirt combination. I can create linux instances without any problem. When i create windows os with Openstack, it gives 64-bit error or not found suitable host error. But when i use virt-manager, vb. to create windows vm on the same host, it operates normally.

when i compare two vm definition xml, there is a slight difference. they are a cpu flag which is "pae" and vm_mode. i have modified glance image to change the vm_mode. and i change it to "hvm". After this change suitable host error is gone, but 64-bit error continues.

libvirt.xml (created by openstack )

   <apic/>                                                                                            </features>

libvirt.xml (created by virt-manager )

   <apic/>                                                                                            </features>

As you see "pae" feature flag does not exist in libvirt.xml file which is created created by openstack. If i manually add that flag to libvirt.xml, problem solves. But whenever i restart the instance, openstack removes that feature flag.

Can i add that flag with modifying glance image definition like vm_mode? Or how can i add it persistently while creating instance using that image?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2014-08-22 11:22:11 -0500

SamYaple gravatar image

updated 2014-08-22 12:50:05 -0500

There is no openstack method to allow for this. However, if you don't mind pae applying to _all_ guest, you can change the default config to include pae.

The file exists at nova/virt/libvirt/ I have not tested it, but you should be able to patch it to the following and have it work

def __init__(self, **kwargs):
    super(LibvirtConfigGuest, self).__init__(root_name="domain",

    self.virt_type = None
    self.uuid = None = None
    self.memory = 1024 * 1024 * 500
    self.vcpus = 1
    self.cpuset = None
    self.cpu = None
    self.cpu_shares = None
    self.cpu_quota = None
    self.cpu_period = None
    self.pae = True
    self.acpi = True
    self.apic = True
    self.clock = None
    self.sysinfo = None
    self.os_type = None
    self.os_loader = None
    self.os_kernel = None
    self.os_initrd = None
    self.os_cmdline = None
    self.os_root = None
    self.os_init_path = None
    self.os_boot_dev = None
    self.os_smbios = None
    self.devices = []

def _format_features(self, root):
    if self.acpi or self.apic or self.pae:
        features = etree.Element("features")
        if self.acpi:
        if self.apic:
        if self.pae:
edit flag offensive delete link more


i think problem roots from libvirt driver, i research that. pea flag should add automatically to libvirt.xml openstack libvirt+xen driver does not add that. but virt-manager does that. may be it is a bug. i found that: (

alissa gravatar imagealissa ( 2014-08-23 04:58:25 -0500 )edit

Yea I noticed, the above changes should add pae. That file is what actually generates the libvirt.xml so making the changes and starting a new instance (or rebuilding an old one) you should see the pae flag.

SamYaple gravatar imageSamYaple ( 2014-08-23 15:29:42 -0500 )edit

do i have to make the changes from all ? (on computes?, on controller?)

alissa gravatar imagealissa ( 2014-08-27 08:01:57 -0500 )edit

Good question. I want to say it is only needed on each compute. However! If you are goign to be changing the source, you should probably package the change and apply it everywhere for consistency.

SamYaple gravatar imageSamYaple ( 2014-08-27 11:51:33 -0500 )edit

answered 2014-08-22 06:21:14 -0500

dbaxps gravatar image

updated 2014-08-22 12:59:57 -0500

Before nova resume VMNAME update libvirt.xml via shell script based on substitution

   [root@icehouse1 ~(keystone_admin)]# cat pae.txt
    [root@icehouse1 ~(keystone_admin)]# perl -plne 'print "<pae/>" if(/apic/);' pae.txt

PAE stands for P-hysical A-ddress E-xtension to access 4 GiB RAM on 32-bit systems

edit flag offensive delete link more


hi, thanks for reply. in xen documents, they clarify the pae feature flag as;

In 64-bit Xen, the pae flag indicates whether the CPU exposed supports long mode. So if you don't set the PAE flag on 64-bit Xen, you get a 32-bit PAE guest. If you do set the PAE flag, you get a 64-bit guest.

alissa gravatar imagealissa ( 2014-08-23 04:55:04 -0500 )edit
dbaxps gravatar imagedbaxps ( 2014-08-23 07:36:22 -0500 )edit

Run on Compute Node

source  keystonerc_boris
V=`nova list | grep $1 | awk '{print $2}'`
perl -plne 'print "<pae/>" if(/apic/);' /var/lib/nova/instances/$V/libvirt.xml
echo "Starting "$1
nova resume $1
dbaxps gravatar imagedbaxps ( 2014-08-23 11:19:15 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools


Asked: 2014-08-22 02:34:08 -0500

Seen: 1,472 times

Last updated: Aug 22 '14