Command syntax for reference: openstack domain <action> <--flags> <domain-name>

<action>: list, create, set, delete…

<--flags>: --enable, --disable, --help…

 

For the first time, when you launch OpenStack after installing it, you may see just one domain, with the name 'default'

 

cumulus@server01:~$ openstack domain list

+----------------------------------+---------+---------+----------------+

| ID                               | Name    | Enabled | Description    |

+----------------------------------+---------+---------+----------------+

| 742e97e33e9641ec8d3aac9420085f60 | default | True    | Default Domain |

+----------------------------------+---------+---------+----------------+

 

Let's try adding a new domain with the name firstDomain

cumulus@server01:~$ openstack domain create firstDomain

+-------------+----------------------------------+

| Field       | Value                            |

+-------------+----------------------------------+

| description |                                  |

| enabled     | True                             |

| id          | 996affed40fb4ce38f6e468246306316 |

| name        | firstDomain                      |

+-------------+----------------------------------+

 

Check the domain list again, it would now contain the newly added domain 'firstDomain'

cumulus@server01:~$ openstack domain list

+----------------------------------+-------------+---------+----------------+

| ID                               | Name        | Enabled | Description    |

+----------------------------------+-------------+---------+----------------+

| 742e97e33e9641ec8d3aac9420085f60 | default     | True    | Default Domain |

| 996affed40fb4ce38f6e468246306316 | firstDomain | True    |                |

+----------------------------------+-------------+---------+----------------+

 

Note that, the Enabled flag above, in column 3, is set to True for both the domains, this means that any newly added domain will be enabled by default, unless explicitly specified, also note that we may not be able to delete a domain with out disabling it, the following commands would explain this behavior

 

cumulus@server01:~$ openstack domain delete firstDomain

Failed to delete domain with name or ID 'firstDomain': Cannot delete a domain that is enabled, please d

isable it first. (HTTP 403) (Request-ID: req-c852249b-8bb5-4e14-8889-721d6c95dbe2)

1 of 1 domains failed to delete.

 

cumulus@server01:~$ openstack domain set --disable firstDOmain

cumulus@server01:~$ openstack domain list

+----------------------------------+-------------+---------+----------------+

| ID                               | Name        | Enabled | Description    |

+----------------------------------+-------------+---------+----------------+

| 742e97e33e9641ec8d3aac9420085f60 | default     | True    | Default Domain |

| 996affed40fb4ce38f6e468246306316 | firstDomain | False   |                |

+----------------------------------+-------------+---------+----------------+

 

Please note above that the domain name is not case sensitive while performing the action, however the domain list output shows the name in the exact case, how it was created initially. To enable the domain back used the flag --enable instead of --disable.

 

Since the domain is disabled, it can now be deleted

cumulus@server01:~$ openstack domain delete firstDOMAIN

cumulus@server01:~$ openstack domain list

+----------------------------------+---------+---------+----------------+

| ID                               | Name    | Enabled | Description    |

+----------------------------------+---------+---------+----------------+

| 742e97e33e9641ec8d3aac9420085f60 | default | True    | Default Domain |

+----------------------------------+---------+---------+----------------+

 

--end-of-post--