VIO host aggregates delete fails with the error: "Unable to delete host aggregate"
search cancel

VIO host aggregates delete fails with the error: "Unable to delete host aggregate"

book

Article ID: 324729

calendar_today

Updated On:

Products

VMware Integrated OpenStack

Issue/Introduction

Symptoms:
  • Deleting host aggregates in the Horizon Dashboard within Admin > System > Host Aggregates section results in the following error:

    Error: Unable to delete host aggregate: <Name_of_the_host_aggregate>

  • Deleting host aggregates from OpenStackClient results in the following error:

    ~# openstack aggregate delete 7

    Cannot remove host from aggregate 7. Reason: Host aggregate is not empty. (HTTP 400) (Request-ID: req-920544b6-b2c3-48f3-ac48-4f7c4dfafc38)

  • In the nova-api.log file, you see entries similar to:

    2017-03-28 21:53:11.094 25877 DEBUG nova.api.openstack.wsgi [req-920544b6-b2c3-48f3-ac48-4f7c4dfafc38 80366402033940189a42a5980e4a0e18 0bcb957f02dd480094fdfd22cec511a9 - - -] Calling method '<bound m</SPAN> ethod AggregateController.delete of <nova.api.openstack.compute.aggregates.AggregateController object at 0x7fc18956a810>>' _process_stack /usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py:6 99
    2017-03-28 21:53:11.107 25877 INFO nova.api.openstack.wsgi [req-920544b6-b2c3-48f3-ac48-4f7c4dfafc38 80366402033940189a42a5980e4a0e18 0bcb957f02dd480094fdfd22cec511a9 - - -] HTTP exception thrown: Ca nnot remove host from aggregate 7. Reason: Host aggregate is not empty.
    2017-03-28 21:53:11.108 25877 DEBUG nova.api.openstack.wsgi [req-920544b6-b2c3-48f3-ac48-4f7c4dfafc38 80366402033940189a42a5980e4a0e18 0bcb957f02dd480094fdfd22cec511a9 - - -] Returning 400 to user:
    Cannot remove host from aggregate 7. Reason: Host aggregate is not empty. __call__ /usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py:1070
    2017-03-28 21:53:11.109 25877 INFO nova.osapi_compute.wsgi.server [req-920544b6-b2c3-48f3-ac48-4f7c4dfafc38 80366402033940189a42a5980e4a0e18 0bcb957f02dd480094fdfd22cec511a9 - - -] 172.20.2.121,172.20.0.133 "DELETE /v2/0bcb957f02dd480094fdfd22cec511a9/os-aggregates/7 HTTP/1.1" status: 400 len: 333 time: 0.0199990

    Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.


Cause

This issue occurs because the hosts aggregates that have a compute-cluster assigned cannot be deleted.

Resolution

To resolve this issue, remove the compute-clusters from the aggregate before attempting to delete.

To remove from the Horizon dashboard

  1. Log in to Horizon dashboard as an admin from the VIO public API IP.
  2. Navigate to Admin > System > Host Aggregates section.
  3. From the Host Aggregate dropdown, click Manage Hosts.
  4. Click the minus (-) symbol for each of the associated compute hosts (Also known as compute-clusters).
  5. Save changes and attempt to delete the Host Aggregate again.

To remove from OpenStack Client

  1. Download and install the OpenStack client. For more information, see Install the OpenStack client.

    Disclaimer: VMware is not responsible for the reliability of any data, opinions, advice, or statements made on third-party websites. Inclusion of such links does not imply that VMware endorses, recommends, or accepts any responsibility for the content of such sites.
  2. Set the environment variables for easier use. This can be done by sourcing a pre-made RC file or by exporting each variable entering the needed information as shown.

    export OS_PROJECT_ID=<Project_ID_Value>
    export OS_REGION_NAME=nova
    export OS_USER_DOMAIN_NAME=Default
    export OS_PROJECT_NAME=<project_Name_The_User_Is_Admin_In>
    export OS_PASSWORD=<password>
    export OS_AUTH_URL=https://<VIO_Public_API_IP>:5000/v3
    export OS_USERNAME=<UserName>

  3. List out the Host Aggregates.

    Example:

    ~# openstack aggregate list

    +----+-----------------+-------------------+
    | ID | Name | Availability Zone |
    +----+-----------------+-------------------+
    | 7 | Lab Aggregate01 | Isolated_Zone |
    +----+-----------------+-------------------+

  4. Show the details of the aggregate to get the host names.

    ~# openstack aggregate show 7

    +-------------------+----------------------------+
    | Field | Value |
    +-------------------+----------------------------+
    | availability_zone | Isolated_Zone |
    | created_at | 2017-03-28T21:44:26.000000 |
    | deleted | False |
    | deleted_at | None |
    | hosts | [u'compute01'] |
    | id | 7 |
    | name | Lab Aggregate01 |
    | properties | |
    | updated_at | None |
    +-------------------+----------------------------+
  5. Remove the hosts from the aggregate.

    ~# openstack aggregate remove host 7 compute01

    +-------------------+------------------------------------------+
    | Field | Value |
    +-------------------+------------------------------------------+
    | availability_zone | Isolated_Zone |
    | created_at | 2017-03-28T21:44:26.000000 |
    | deleted | False |
    | deleted_at | None |
    | hosts | [] |
    | id | 7 |
    | metadata | {u'availability_zone': u'Isolated_Zone'} |
    | name | Lab Aggregate01 |
    | updated_at | None |
    +-------------------+------------------------------------------+

  6. Attempt to delete the aggregate again. There is no return output on success.

    ~# openstack aggregate delete 7

    The delete can be confirmed by listing the aggregates a second time.

    Note: If there are no remaining host aggregates, the returned output will be empty as shown in the example. Else, the remaining aggregates will be listed without the deleted aggregate.

    ~# openstack aggregate list