Add optional support for --libvirt_xml_template reloading

Bug #723235 reported by Andre Naehring
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Wishlist
Alvaro Lopez

Bug Description

Using the flag "--libvirt_xml_template" in nova.conf, the template file is only read once when starting nova-compute. For each change in the template file you have to restart nova-compute.

Revision history for this message
Vish Ishaya (vishvananda) wrote : Re: [Bug 723235] [NEW] flag --libvirt_xml_template only read once while nova-services launching

I don't think this is really a bug. Perhaps it could be a feature request, but I'm not sure of the value of it. In production the xml shouldn't change. In dev mode it isn't that bad to have to restart the worker if you change it.

Vish

On Feb 22, 2011, at 8:34 AM, Andre Nähring wrote:

> Public bug reported:
>
> Using the flag "--libvirt_xml_template" in nova.conf, the template file
> is only read one when starting nova-compute. For each change in the
> template file you have to restart nova-compute.
>
> ** Affects: nova
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are a member of Nova Bug
> Team, which is subscribed to OpenStack Compute (nova).
> https://bugs.launchpad.net/bugs/723235
>
> Title:
> flag --libvirt_xml_template only read once while nova-services
> launching
>
> Status in OpenStack Compute (Nova):
> New
>
> Bug description:
> Using the flag "--libvirt_xml_template" in nova.conf, the template
> file is only read one when starting nova-compute. For each change in
> the template file you have to restart nova-compute.

Revision history for this message
Thierry Carrez (ttx) wrote : Re: flag --libvirt_xml_template only read once while nova-services launching

Could you explain your use case ?

Changed in nova:
importance: Undecided → Wishlist
status: New → Incomplete
Revision history for this message
Andre Naehring (naehring) wrote :

We have been testing special images running in xen in use with nova. Several changes to the xml template have been neccessary to use with our images. It took some time to me, to find out why the changes won't be applied.

Maybe we can add another flag e.g. "--debug_libvirt_template=[true/false]" ? When true, compute should read the libvirt template each time an instance is created. When false (default) it should be read only once.

If this is interesting to you, I would spend time to learn some python and create the neccessary changes. But this does only make sense if I am not the only person with this use case.

Revision history for this message
Thierry Carrez (ttx) wrote :

I think that's a bit of a corner case... but if you want to scratch your own itch, I certainly won't prevent you from contributing code :)

Changed in nova:
status: Incomplete → Confirmed
summary: - flag --libvirt_xml_template only read once while nova-services launching
+ Add optional support for --libvirt_xml_template reloading
Alvaro Lopez (aloga)
Changed in nova:
assignee: nobody → Alvaro (aloga)
status: Confirmed → In Progress
description: updated
Revision history for this message
Soren Hansen (soren) wrote :

Right now, we read the xml during instantiation of the libvirt driver. Just move that call into the spawn() method, and you should be fine. It's a pointless optimisation anyway.

It's a local file. If it made a difference to cache a local, small file in memory rather than reading it every time we need it (which is only whenever we need to boot a new VM), we'd be in serious trouble.

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/2068
Committed: http://github.com/openstack/nova/commit/f68abf9b0e3e2ba206c560c19db321c6f88670f1
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit f68abf9b0e3e2ba206c560c19db321c6f88670f1
Author: Alvaro Lopez Garcia <email address hidden>
Date: Fri Dec 2 14:18:38 2011 +0100

    Fixes bug 723235

    The XML templates have been converted into properties, thus we can
    compare the mtime of the XML templates (libvirt and cpuinfo) each
    time they are needed, checking if they have been modified and
    reloading them. Added a function to read cached files.

    Change-Id: I6cf0229c6435300e73f9d9a6b10b0bf9bf144a55

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.