IT/openstack

nova 서비스에서 compute node 제거 절차

울티마 2015. 9. 3. 10:26

OpenStack의 nova 서비스에서 compute node를 제거하는 command가 없음.

 

nova database에서 직접 제거해야 함

 

1. 서비스 확인

 

root@controller:~# nova service-list

 

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

 

| Id | Binary           | Host       | Zone     | Status   | State | Updated_at                 | Disabled Reason |

 

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

 

| 1  | nova-cert        | controller | internal | enabled  | up    | 2015-09-03T00:59:23.000000 | -               |

 

| 2  | nova-consoleauth | controller | internal | enabled  | up    | 2015-09-03T00:59:23.000000 | -               |

 

| 3  | nova-scheduler   | controller | internal | enabled  | up    | 2015-09-03T00:59:21.000000 | -               |

 

| 4  | nova-conductor   | controller | internal | enabled  | up    | 2015-09-03T00:59:15.000000 | -               |

 

| 5  | nova-compute     | compute1   | nova     | enabled  | up    | 2015-09-03T00:59:22.000000 | -               |

 

| 6  | nova-network     | compute1   | internal | enabled  | up    | 2015-09-03T00:59:20.000000 | -               |

 

| 7  | nova-network     | compute2   | internal | enabled  | up    | 2015-09-03T00:59:23.000000 | -               |

 

| 8  | nova-compute     | compute2   | nova     | enabled  | up    | 2015-09-03T00:59:15.000000 | -               |

 

| 9  | nova-network     | compute3   | internal | enabled  | up    | 2015-09-03T00:59:18.000000 | -               |

 

| 10 | nova-compute     | compute3   | nova     | enabled  | up    | 2015-09-03T00:59:18.000000 | -               |

 

| 11 | nova-network     | compute4   | internal | enabled  | down  | 2015-09-02T08:45:55.000000 | -               |

 

| 12 | nova-compute     | compute4   | nova     | enabled  | up    | 2015-09-03T00:59:17.000000 | None            |

 

| 13 | nova-compute     | compute5   | nova     | disabled | up    | 2015-09-03T00:58:56.000000 | -               |

 

| 14 | nova-network     | compute5   | internal | disabled | up    | 2015-09-03T00:59:05.000000 | -               |

 

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

 

2. 서비스 disable

 

root@controller:~# nova service-disable compute5 nova-compute

 

root@controller:~# nova service-disable compute5 nova-network

 

 

3. Hypervisor 정보 확인

 

root@controller:~# nova hypervisor-list

 

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

 

| ID | Hypervisor hostname |

 

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

 

| 1  | compute1            |

 

| 2  | compute2            |

 

| 3  | compute3            |

 

| 4  | compute4            |

 

| 5  | compute5            |

 

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

 

 

3. Database에서 정보 삭제

 

root@controller:~# mysql -u root -p

 

- compute_nodes, services 두 개 테이블이 Foreign Key로 연결되어 있어 순서대로 정보 삭제 해야 함

 

(1) compute_nodes 테이벌 정보 삭제

 

- Compute Node 정보 table

 

MariaDB [nova]> desc compute_nodes;

 

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

 

| Field                | Type         | Null | Key | Default | Extra          |

 

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

 

| created_at           | datetime     | YES  |     | NULL    |                |

 

| updated_at           | datetime     | YES  |     | NULL    |                |

 

| deleted_at           | datetime     | YES  |     | NULL    |                |

 

| id                   | int(11)      | NO   | PRI | NULL    | auto_increment |

 

| service_id           | int(11)      | NO   | MUL | NULL    |                |

 

| vcpus                | int(11)      | NO   |     | NULL    |                |

 

| memory_mb            | int(11)      | NO   |     | NULL    |                |

 

| local_gb             | int(11)      | NO   |     | NULL    |                |

 

| vcpus_used           | int(11)      | NO   |     | NULL    |                |

 

| memory_mb_used       | int(11)      | NO   |     | NULL    |                |

 

| local_gb_used        | int(11)      | NO   |     | NULL    |

               |

| hypervisor_type      | mediumtext   | NO   |     | NULL    |                |

 

| hypervisor_version   | int(11)      | NO   |     | NULL    |                |

 

| cpu_info             | mediumtext   | NO   |     | NULL    |                |

 

| disk_available_least | int(11)      | YES  |     | NULL    |                |

 

| free_ram_mb          | int(11)      | YES  |     | NULL    |                |

 

| free_disk_gb         | int(11)      | YES  |     | NULL    |                |

 

| current_workload     | int(11)      | YES  |     | NULL    |                |

 

| running_vms          | int(11)      | YES  |     | NULL    |                |

 

| hypervisor_hostname  | varchar(255) | YES  |     | NULL    |        

       |

| deleted              | int(11)      | YES  |     | NULL    |                |

 

| host_ip              | varchar(39)  | YES  |     | NULL    |                |

 

| supported_instances  | text         | YES  |     | NULL    |                |

 

| pci_stats            | text         | YES  |     | NULL    |                |

 

| metrics              | text         | YES  |     | NULL    |                |

 

| extra_resources      | text         | YES  |     | NULL    |                |

 

| stats                | text         | YES  |     | NULL    |                |

 

| numa_topology        | text         | YES  |     | NULL    |                |

 

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

 

MariaDB [nova]> select id,service_id,hypervisor_hostname from compute_nodes;

 

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

 

| id | service_id | hypervisor_hostname |

 

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

 

|  1 |          5 | compute1            |

 

|  2 |          8 | compute2            |

 

|  3 |         10 | compute3            |

 

|  4 |         12 | compute4            |

 

|  5 |         13 | compute5            |

 

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

 

 

- compute5의 정보 삭제

 

MariaDB [nova]> delete from compute_nodes where id=5;

 

Query OK, 1 row affected (0.00 sec)

 

 

(2) services 테이블 정보 삭제

 

- services 테이블 조회 및 삭제

 

MariaDB [nova]> select * from services;

 

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

 

| created_at          | updated_at          | deleted_at | id | host       | binary           | topic       | report_count | disabled     | deleted | disabled_reason |

 

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

| 2015-08-24 06:25:42 | 2015-09-03 00:58:56 | NULL       | 13 | compute5   | nova-compute     | compute     |        84345 |        1     |       0 | NULL            |

 

| 2015-08-24 06:26:23 | 2015-09-03 00:59:05 | NULL       | 14 | compute5   | nova-network     | network     |        84344 |        1     |       0 | NULL            |

 

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

 

14 rows in set (0.00 sec)

 

 

- services 테이블 삭제

 

MariaDB [nova]> delete from services where id=13;

 

Query OK, 1 row affected (0.00 sec)

 

 

MariaDB [nova]> delete from services where id=14;

 

Query OK, 1 row affected (0.00 sec)

 

 

4. 서비스 정보 및 hypervisor 정보 조회

 

root@controller:~# nova service-list

 

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

 

| Id | Binary           | Host       | Zone     | Status   | State | Updated_at                 | Disabled Reason |

 

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

 

| 1  | nova-cert        | controller | internal | enabled  | up    | 2015-09-03T01:10:43.000000 | -               |

 

| 2  | nova-consoleauth | controller | internal | enabled  | up    | 2015-09-03T01:10:43.000000 | -               |

 

| 3  | nova-scheduler   | controller | internal | enabled  | up    | 2015-09-03T01:10:41.000000 | -               |

 

| 4  | nova-conductor   | controller | internal | enabled  | up    | 2015-09-03T01:10:45.000000 | -               |

 

| 5  | nova-compute     | compute1   | nova     | enabled  | up    | 2015-09-03T01:10:42.000000 | -              

|

| 6  | nova-network     | compute1   | internal | enabled  | up    | 2015-09-03T01:10:40.000000 | -               |

 

| 7  | nova-network     | compute2   | internal | enabled  | up    | 2015-09-03T01:10:43.000000 | -               |

 

| 8  | nova-compute     | compute2   | nova     | enabled  | up    | 2015-09-03T01:10:45.000000 | -               |

 

| 9  | nova-network     | compute3   | internal | enabled  | up    | 2015-09-03T01:10:48.000000 | -               |

 

| 10 | nova-compute     | compute3   | nova     | enabled  | up    | 2015-09-03T01:10:48.000000 | -               |

 

| 11 | nova-network     | compute4   | internal | disabled | up    | 2015-09-03T01:10:40.000000 | -               |

 

| 12 | nova-compute     | compute4   | nova     | disabled | up    | 2015-09-03T01:10:47.000000 | -               |

 

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

 

root@controller:~#

 

root@controller:~# nova hypervisor-list

 

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

 

| ID | Hypervisor hostname |

 

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

 

| 1  | compute1            |

 

| 2  | compute2            |

 

| 3  | compute3            |

 

| 4  | compute4            |

 

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

 

 

5. 해당 노드에서 nova 관련 서비스 제거