Openstack computeノード削除

OpenstackのComputeノードの削除の方法がなかったのでメモ。

  • Centos/Junoで確認。
    ただし、正しいドキュメントがないので、少々不安な手順

削除したいコンピュートノードの確認

[root@controller ~(keystone_admin)]# nova service-list
+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| Binary           | Host       | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| nova-consoleauth | controller | internal | enabled | up    | 2016-02-10T02:00:17.000000 | -               |
| nova-scheduler   | controller | internal | enabled | up    | 2016-02-10T02:00:17.000000 | -               |
| nova-conductor   | controller | internal | enabled | up    | 2016-02-10T02:00:17.000000 | -               |
| nova-cert        | controller | internal | enabled | up    | 2016-02-10T02:00:16.000000 | -               |
| nova-compute     | compute2   | compute2 | enabled | up    | 2016-02-10T02:00:18.000000 | -               |
| nova-compute     | compute1   | compute1 | enabled | up    | 2016-02-10T02:00:18.000000 | -               |
+------------------+------------+----------+---------+-------+----------------------------+-----------------+

コンピュートノードのDisable

[root@controller ~(keystone_admin)]# nova-manage service disable --host=compute1 --service=nova-compute

コンピュートノードをDB上から削除

[root@controller ~(keystone_admin)]# mysql -u root -p
MariaDB [(none)] use nova;
MariaDB [nova] select id, hypervisor_hostname  from compute_nodes;
+----+-----------------------+
| id | hypervisor_hostname   |
+----+-----------------------+
|  1 | compute2              |
|  2 | compute1              |
+----+-----------------------+
1 row in set (0.00 sec)
MariaDB [nova] delete from compute_nodes where hypervisor_hostname='compute1'
MariaDB [nova] 
MariaDB [nova] select id,host from services;
+----+--------------+
| id | host         |
+----+--------------+
|  6 | compute1     |
|  5 | compute2     |
|  4 | controller   |
|  3 | controller   |
|  1 | controller   |
|  2 | controller   |
+----+--------------+
5 rows in set (0.00 sec)

MariaDB [nova] delete from services where host='compute1'
MariaDB [nova] 

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください