I have 3 resource/compute clusters in a VDS-only, VIO 3.0, HA deployment. How can I ensure that a particular instance is deployed on a particular cluster? For example, I have prod, non-prod, and test clusters and I want a new prod instance deployed directly to the prod cluster. How can I make that happen in the course of a typical instance deployment workflow?
If you want to give tenants an option to choose these different environments, then one approach could be exposing your prod, non-prod, & test clusters are different availability zones (AZ).
Create 3 host-aggregates and expose them as AZs. When you boot an instance, pass the AZ where the instances should be placed.
references:
http://docs.openstack.org/admin-guide/dashboard-manage-host-aggregates.html
Another option is using flavor extra specs & host aggregate. Note: the placement will be automatic based on flavor selected.
"AggregateInstanceExtraSpecsFilter" is the filter than be used.
nova aggregate-create production nova
+----+------------+-------------------+-------+--------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+------------+-------------------+-------+--------------------------+
| 1 | production | nova | | 'availability_zone=nova' |
+----+------------+-------------------+-------+--------------------------+
(openstack)~ $ nova aggregate-create development nova
+----+-------------+-------------------+-------+--------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+-------------+-------------------+-------+--------------------------+
| 4 | development | nova | | 'availability_zone=nova' |
+----+-------------+-------------------+-------+--------------------------+
(openstack)~ $ nova aggregate-set-metadata 1 env=prod
Metadata has been successfully updated for aggregate 1.
+----+------------+-------------------+-------+--------------------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+------------+-------------------+-------+--------------------------------------+
| 1 | production | nova | | 'availability_zone=nova', 'env=prod' |
+----+------------+-------------------+-------+--------------------------------------+
(openstack)~ $ nova aggregate-set-metadata 4 env=dev
Metadata has been successfully updated for aggregate 4.
+----+-------------+-------------------+-------+-------------------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+-------------+-------------------+-------+-------------------------------------+
| 4 | development | nova | | 'availability_zone=nova', 'env=dev' |
+----+-------------+-------------------+-------+-------------------------------------+
• Get list of compute drivers and add as appropriate to the production and development aggregates
(openstack)~ $ nova host-list
+--------------+-------------+----------+
| host_name | service | zone |
+--------------+-------------+----------+
| controller02 | conductor | internal |
| controller01 | conductor | internal |
| controller02 | scheduler | internal |
| controller01 | scheduler | internal |
| controller02 | consoleauth | internal |
| controller01 | consoleauth | internal |
| compute01 | compute | nova |
| compute02 | compute | nova |
+--------------+-------------+----------+
(openstack)~ $ nova aggregate-add-host 1 compute01
Host compute01 has been successfully added for aggregate 1
+----+------------+-------------------+-------------+--------------------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+------------+-------------------+-------------+--------------------------------------+
| 1 | production | nova | 'compute01' | 'availability_zone=nova', 'env=prod' |
+----+------------+-------------------+-------------+--------------------------------------+
(openstack)~ $ nova aggregate-add-host 4 compute02
Host compute02 has been successfully added for aggregate 4
+----+-------------+-------------------+-------------+-------------------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+-------------+-------------------+-------------+-------------------------------------+
| 4 | development | nova | 'compute02' | 'availability_zone=nova', 'env=dev' |
+----+-------------+-------------------+-------------+-------------------------------------+
• Pattern your new flavors after an existing one. In this example, m1.small.
(openstack)~ $ nova flavor-show m1.small
+----------------------------+----------+
| Property | Value |
+----------------------------+----------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 20 |
| extra_specs | {} |
| id | 2 |
| name | m1.small |
| os-flavor-access:is_public | True |
| ram | 2048 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 1 |
+----------------------------+----------+
(openstack)~ $ nova flavor-create prod.small auto 2048 20 1
+--------------------------------------+------------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+--------------------------------------+------------+-----------+------+-----------+------+-------+-------------+-----------+
| e0174c1d-30e5-4068-874a-a2563da2ce09 | prod.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
+--------------------------------------+------------+-----------+------+-----------+------+-------+-------------+-----------+
(openstack)~ $ nova flavor-create dev.small auto 2048 20 1
+--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ab5e5a29-ae1a-44e1-9713-48e3f8cd2426 | dev.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
+--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
• Add extra specs data to your new flavors.
(openstack)~ $ nova flavor-key prod.small set aggregate_instance_extra_specs:env=prod
(openstack)~ $ nova flavor-key dev.small set aggregate_instance_extra_specs:env=dev
If you want to give tenants an option to choose these different environments, then one approach could be exposing your prod, non-prod, & test clusters are different availability zones (AZ).
Create 3 host-aggregates and expose them as AZs. When you boot an instance, pass the AZ where the instances should be placed.
references:
http://docs.openstack.org/admin-guide/dashboard-manage-host-aggregates.html
Another option is using flavor extra specs & host aggregate. Note: the placement will be automatic based on flavor selected.
"AggregateInstanceExtraSpecsFilter" is the filter than be used.
nova aggregate-create production nova
+----+------------+-------------------+-------+--------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+------------+-------------------+-------+--------------------------+
| 1 | production | nova | | 'availability_zone=nova' |
+----+------------+-------------------+-------+--------------------------+
(openstack)~ $ nova aggregate-create development nova
+----+-------------+-------------------+-------+--------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+-------------+-------------------+-------+--------------------------+
| 4 | development | nova | | 'availability_zone=nova' |
+----+-------------+-------------------+-------+--------------------------+
(openstack)~ $ nova aggregate-set-metadata 1 env=prod
Metadata has been successfully updated for aggregate 1.
+----+------------+-------------------+-------+--------------------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+------------+-------------------+-------+--------------------------------------+
| 1 | production | nova | | 'availability_zone=nova', 'env=prod' |
+----+------------+-------------------+-------+--------------------------------------+
(openstack)~ $ nova aggregate-set-metadata 4 env=dev
Metadata has been successfully updated for aggregate 4.
+----+-------------+-------------------+-------+-------------------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+-------------+-------------------+-------+-------------------------------------+
| 4 | development | nova | | 'availability_zone=nova', 'env=dev' |
+----+-------------+-------------------+-------+-------------------------------------+
• Get list of compute drivers and add as appropriate to the production and development aggregates
(openstack)~ $ nova host-list
+--------------+-------------+----------+
| host_name | service | zone |
+--------------+-------------+----------+
| controller02 | conductor | internal |
| controller01 | conductor | internal |
| controller02 | scheduler | internal |
| controller01 | scheduler | internal |
| controller02 | consoleauth | internal |
| controller01 | consoleauth | internal |
| compute01 | compute | nova |
| compute02 | compute | nova |
+--------------+-------------+----------+
(openstack)~ $ nova aggregate-add-host 1 compute01
Host compute01 has been successfully added for aggregate 1
+----+------------+-------------------+-------------+--------------------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+------------+-------------------+-------------+--------------------------------------+
| 1 | production | nova | 'compute01' | 'availability_zone=nova', 'env=prod' |
+----+------------+-------------------+-------------+--------------------------------------+
(openstack)~ $ nova aggregate-add-host 4 compute02
Host compute02 has been successfully added for aggregate 4
+----+-------------+-------------------+-------------+-------------------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+-------------+-------------------+-------------+-------------------------------------+
| 4 | development | nova | 'compute02' | 'availability_zone=nova', 'env=dev' |
+----+-------------+-------------------+-------------+-------------------------------------+
• Pattern your new flavors after an existing one. In this example, m1.small.
(openstack)~ $ nova flavor-show m1.small
+----------------------------+----------+
| Property | Value |
+----------------------------+----------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 20 |
| extra_specs | {} |
| id | 2 |
| name | m1.small |
| os-flavor-access:is_public | True |
| ram | 2048 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 1 |
+----------------------------+----------+
(openstack)~ $ nova flavor-create prod.small auto 2048 20 1
+--------------------------------------+------------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+--------------------------------------+------------+-----------+------+-----------+------+-------+-------------+-----------+
| e0174c1d-30e5-4068-874a-a2563da2ce09 | prod.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
+--------------------------------------+------------+-----------+------+-----------+------+-------+-------------+-----------+
(openstack)~ $ nova flavor-create dev.small auto 2048 20 1
+--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ab5e5a29-ae1a-44e1-9713-48e3f8cd2426 | dev.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
+--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
• Add extra specs data to your new flavors.
(openstack)~ $ nova flavor-key prod.small set aggregate_instance_extra_specs:env=prod
(openstack)~ $ nova flavor-key dev.small set aggregate_instance_extra_specs:env=dev
This is outstanding, thank you. Is this setup supported by VMware?
Yes, it is supported by VIO.
Is it supported in VIO 7?