Hide Forgot
Cloned from launchpad blueprint https://blueprints.launchpad.net/nova/+spec/aggregate-host-isolation-based-image-properties. Description: The implementation of the blueprint “Host isolation based on image properties by the way of aggregate metadata” defines that: - if a host belongs to an aggregate and if this aggregate defines one or several metadata that match with the image properties then the host is a candidate to boot the instance. - If a host doesn't belong to any aggregate it can create instances from all images. The goal for this blueprint is to implement a new scheduler filter "AggegateImagePropertiesIsolate" that isolates an image from his properties to a host by the way of an aggregate. Example: ubuntu@sf-devel:~$ nova aggregate-details windows +----+---------+-------------------+------------+--------------+ | Id | Name | Availability Zone | Hosts | Metadata | +----+---------+-------------------+------------+--------------+ | 1 | windows | None | 'sf-devel' | 'os=windows' | +----+---------+-------------------+------------+--------------+ ubuntu@sf-devel:~$ glance image-show cirros-0.3.1-x86_64-uec +------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ | Property 'os' | windows | | checksum | f8a2eeee2dc65b3d9b6e63678955bd83 | | container_format | ami | | created_at | 2013-11-14T13:24:25 | ... The image above will boot on sf-devel. Specification URL (additional information): None
To use the AggregateImagePropertiesIsolation, the first thing is to add it to the list of 'scheduler_default_filters' in nova.conf and restart the scheduler. If the properties are going to be namespaced you'll need to set the namespace in 'aggregate_image_properties_isolation_namespace' too. You'll need a setup with two compute nodes and: 1. Upload two images to glance (for this I've used cirros and fedora). 2. Choose a property and set a different value for each image: - glance image-update --property os=cirros cirros - glance image-update --property os=fedora fedora 3. Create two aggregates, update their metadata so each one has the same value of one of the images and assign a host to each one: - nova aggregate-create fedora - nova aggregate-set-metadata fedora os=fedora - nova aggregate-add-host fedora <hostname01> - nova aggregate-create cirros - nova aggregate-set-metadata cirros os=cirros - nova aggregate-add-host cirros <hostname02> 4. Boot an instance with each of the images. Notice that they'll be started in the host in the aggregate which has the same value for the property as the image. 5. Check the scheduler log (in debug level) and notice that the filter returns only one host: - "Filter AggregateImagePropertiesIsolation returned 1 host" 6. If a host is not in any aggregate or the image doesn't specify the property defined in the aggregate the host shouldn't be ruled out of the host list while scheduling.
Successfully Tested using the steps from comment #3 With : RDO Ice-house (openstack-nova-2014.1-0.11.b3.el6.noarch). http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHEA-2014-0853.html