Bug 1041118

Summary: [RFE][nova]: Aggregate: Host isolation based on image properties
Product: Red Hat OpenStack Reporter: RHOS Integration <rhos-integ>
Component: openstack-novaAssignee: Vladan Popovic <vpopovic>
Status: CLOSED ERRATA QA Contact: Omri Hochman <ohochman>
Severity: low Docs Contact:
Priority: medium    
Version: unspecifiedCC: markmc, ndipanov, ohochman, sgordon, slong, vpopovic, yeylon
Target Milestone: Upstream M2Keywords: FutureFeature, Triaged
Target Release: 5.0 (RHEL 7)   
Hardware: Unspecified   
OS: Unspecified   
URL: https://blueprints.launchpad.net/nova/+spec/aggregate-host-isolation-based-image-properties
Whiteboard: upstream_milestone_icehouse-2 upstream_status_implemented upstream_definition_approved
Fixed In Version: openstack-nova-2014.1-3.el7ost Doc Type: Enhancement
Doc Text:
A new scheduler filter, "AggregateImagePropertiesIsolation", has been introduced. The new filter schedules instances to hosts based on matching namespaced image properties with host aggregate properties. Hosts that do not belong to any host aggregate remain valid scheduling targets for instances based on all images. The new Compute service configuration keys "aggregate_image_properties_isolation_namespace" and "aggregate_image_properties_isolation_separator" are used to determine which image properties are examined by the filter.
Story Points: ---
Clone Of:
: 1082389 (view as bug list) Environment:
Last Closed: 2014-07-08 15:27:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1082389    

Description RHOS Integration 2013-12-12 13:41:51 UTC
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

Comment 3 Xavier Queralt 2014-04-01 14:08:29 UTC
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.

Comment 4 Omri Hochman 2014-04-02 12:29:04 UTC
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/

Comment 10 errata-xmlrpc 2014-07-08 15:27:24 UTC
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