No Valid Host From Host Aggregates Resulted in Instance Spawning Failure

Problem

Cold Migration for the instance failed as it could not find any valid host for the instance to be deployed on.
It queried the hosts available within host aggregates, however, since the flavor used for the instance did not match with any of the host aggregate metadata, migration failed.

# less nova-scheduler.log | grep <UUID>
INFO nova.filters [req-XYZ <UUID> <PROJECTUUID> - - -] Filtering removed all hosts for the request with instance ID '<UUID>'. Filter results: ['RetryFilter: (start: 8, end: 8)', 'AggregateMultiTenancyIsolation: (start: 8, end: 6)', 'AvailabilityZoneFilter: (start: 6, end: 6)', 'ServerGroupAffinityFilter: (start: 6, end: 6)', 'ServerGroupAntiAffinityFilter: (start: 6, end: 6)', 'AggregateInstanceExtraSpecsFilter: (start: 6, end: 0)']

# openstack server show <UUID> --fit-width
+-------------------------------------+------------------------------------------------------
| Field                              | Value                                                
+-------------------------------------+------------------------------------------------------
| OS-DCF:diskConfig                  | MANUAL                                                
| OS-EXT-AZ:availability_zone        | nova                                                  
| OS-EXT-PF9-SRV-RES-INFO:res_info    | {u'cfg_disk_gb': 150.0, u'vcpus': 4, u'cfg_memory_mb': 65536, u'cpu_mhz': 1000}                    |
| OS-EXT-SRV-ATTR:host                | <HOST>                  
| OS-EXT-SRV-ATTR:hypervisor_hostname | <HOSTNAME>                                  
| OS-EXT-SRV-ATTR:instance_name      | <INSTANCE_NAME>                 
| OS-EXT-STS:fault                    | {u'message': u'No valid host was found. \n6 hosts failed with error: Can not find a host aggregate | matching instance extra spec requirement', u'code': 500, u'details': u'  File| OS-EXT-STS:power_state              | Shutdown            
| OS-EXT-STS:task_state              | None                                                  
| OS-EXT-STS:vm_state                | stopped

Environment

  • Platform9 Managed OpenStack - All Versions

Cause

Host aggregate to match the instance flavor specifications is not present.

# openstack flavor show SampleFlavor
+----------------------------+-----------------------+
| Field                      | Value                 |
+----------------------------+-----------------------+
| OS-FLV-DISABLED:disabled   | False                 |
| OS-FLV-EXT-DATA:ephemeral  | 0                     |
| access_project_ids         | None                  |
| disk                       | 80                    |
| id                         | 6                     |
| name                       | SampleFlavor          |
| os-flavor-access:is_public | True                  |
| properties                 | host='AggregateMatch' |
| ram                        | 8192                  |
| rxtx_factor                | 1.0                   |
| swap                       |                       |
| vcpus                      | 4                     |
+----------------------------+-----------------------+

# openstack aggregate list | grep sampleagg

Resolution

  1. Create a host aggregate matching the Instance flavor specifications.

    openstack aggregate create sampleagg openstack aggregate set --property host=‘AggregateMatch’
    $ openstack aggregate add host 1

  2. If the flavor properties is not set, it is mandatory to specify one or more key-value pairs that match the key-value pairs on the host aggregates with the scope *

    aggregate_instance_extra_specs* . For our case, it is the aggregate_instance_extra_specs : host='AggregateMatch’ key-value pair.

  3. Set the key-value pair using the following command.

    $ openstack flavor set SampleFlavor --property host='AggregateMatch'

Additional Information

OpenStack Host Aggregate Document