NTNX>日記

個人的な趣味による Nutanix Community Edition 日記。Japanese のみですみません。

Nutanix CE で OpenStack。Part5: OVM-services 構成の動作確認。

Nutanix ₊ OpenStack を Controller と Acropolice Driver ノードを別サーバとして構成してみました。今回は、Nova / Neutron / Cinder / Glance のサービスが実際に使用できることを確認します。

前回構成した環境を OS ごと再起動して、下記のような状態にしてあります。

 OVM#1(Acropolis Driver-Only Mode)

[root@ovm01 ~]# openstack-status
== Nova services ==
openstack-nova-api:                     inactive  (disabled on boot)
openstack-nova-cert:                    inactive  (disabled on boot)
openstack-nova-compute:                 active
openstack-nova-network:                 inactive  (disabled on boot)
openstack-nova-scheduler:               inactive  (disabled on boot)
openstack-nova-conductor:               inactive  (disabled on boot)
== Glance services ==
openstack-glance-api:                   active
openstack-glance-registry:              active
== Keystone service ==
openstack-keystone:                     active
== Horizon service ==
openstack-dashboard:                    active
== neutron services ==
neutron-server:                         active
neutron-dhcp-agent:                     inactive  (disabled on boot)
neutron-l3-agent:                       inactive  (disabled on boot)
neutron-metadata-agent:                 inactive  (disabled on boot)
neutron-openvswitch-agent:              inactive  (disabled on boot)
== Swift services ==
openstack-swift-proxy:                  active
openstack-swift-account:                active
openstack-swift-container:              active
openstack-swift-object:                 active
== Cinder services ==
openstack-cinder-api:                   inactive  (disabled on boot)
openstack-cinder-scheduler:             inactive  (disabled on boot)
openstack-cinder-volume:                active
openstack-cinder-backup:                inactive  (disabled on boot)
== Ceilometer services ==
openstack-ceilometer-api:               active
openstack-ceilometer-central:           active
openstack-ceilometer-compute:           inactive  (disabled on boot)
openstack-ceilometer-collector:         active
openstack-ceilometer-alarm-notifier:    active
openstack-ceilometer-alarm-evaluator:   active
openstack-ceilometer-notification:      active
== Heat services ==
openstack-heat-api:                     active
openstack-heat-api-cfn:                 inactive  (disabled on boot)
openstack-heat-api-cloudwatch:          inactive  (disabled on boot)
openstack-heat-engine:                  active
== Sahara services ==
openstack-sahara-api:                   inactive  (disabled on boot)
== Trove services ==
openstack-trove-api:                    active
openstack-trove-taskmanager:            active
openstack-trove-conductor:              active
== Support services ==
mysqld:                                 active    (disabled on boot)
openvswitch:                            inactive  (disabled on boot)
dbus:                                   active
target:                                 active
rabbitmq-server:                        active
memcached:                              active
== Keystone users ==
Warning keystonerc not sourced

OVM#2(OpenStack Controller)

[root@ovm02 ~]# openstack-status
== Nova services ==
openstack-nova-api:                     active
openstack-nova-cert:                    active
openstack-nova-compute:                 inactive  (disabled on boot)
openstack-nova-network:                 inactive  (disabled on boot)
openstack-nova-scheduler:               active
openstack-nova-conductor:               active
== Glance services ==
openstack-glance-api:                   inactive  (disabled on boot)
openstack-glance-registry:              inactive  (disabled on boot)
== Keystone service ==
openstack-keystone:                     active
== Horizon service ==
openstack-dashboard:                    active
== neutron services ==
neutron-server:                         active
neutron-dhcp-agent:                     inactive  (disabled on boot)
neutron-l3-agent:                       inactive  (disabled on boot)
neutron-metadata-agent:                 inactive  (disabled on boot)
neutron-openvswitch-agent:              inactive  (disabled on boot)
== Swift services ==
openstack-swift-proxy:                  active
openstack-swift-account:                active
openstack-swift-container:              active
openstack-swift-object:                 active
== Cinder services ==
openstack-cinder-api:                   active
openstack-cinder-scheduler:             active
openstack-cinder-volume:                inactive  (disabled on boot)
openstack-cinder-backup:                active
== Ceilometer services ==
openstack-ceilometer-api:               active
openstack-ceilometer-central:           active
openstack-ceilometer-compute:           inactive  (disabled on boot)
openstack-ceilometer-collector:         active
openstack-ceilometer-alarm-notifier:    active
openstack-ceilometer-alarm-evaluator:   active
openstack-ceilometer-notification:      active
== Heat services ==
openstack-heat-api:                     active
openstack-heat-api-cfn:                 inactive  (disabled on boot)
openstack-heat-api-cloudwatch:          inactive  (disabled on boot)
openstack-heat-engine:                  active
== Sahara services ==
openstack-sahara-api:                   inactive  (disabled on boot)
== Trove services ==
openstack-trove-api:                    active
openstack-trove-taskmanager:            active
openstack-trove-conductor:              active
== Support services ==
mysqld:                                 active    (disabled on boot)
openvswitch:                            inactive  (disabled on boot)
dbus:                                   active
rabbitmq-server:                        active
memcached:                              active
== Keystone users ==
Warning keystonerc not sourced

今回は CLI から操作してみます。そして Nutanix の Prism UI でも結果を確認してみます。

環境変数の読み込み

/root/keystonerc_admin ファイルです。

[root@ovm02 ~]# cat keystonerc_admin
unset OS_SERVICE_TOKEN
export OS_USERNAME=admin
export OS_PASSWORD=admin
export OS_AUTH_URL=http://127.0.0.1:5000/v2.0
export PS1='[\u@\h \W(keystone_admin)]\$ '

export OS_TENANT_NAME=admin
export OS_REGION_NAME=RegionOne

せっかくなので、OS_AUTH_URL を Controller である OVM#2 のアドレスにしておきます。

[root@ovm02 ~]# source keystonerc_admin
[root@ovm02 ~(keystone_admin)]# export OS_AUTH_URL=http://ovm02.ntnx.local:5000/v2.0

Image サービス (Glance)

QCAW2 の OS イメージを登録してみます。今回は、Oracle Linux 6.6 の OpenStack 用イメージを ol66 という名前で登録しています。

[root@ovm02 ~(keystone_admin)]# glance image-create --name=ol66 \
> --file=OracleLinux-6.6-x86_64.qcow2 \
> --container-format=bare \
> --disk-format=qcow2 \
> --is-public=true
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | 0                                    |
| container_format | bare                                 |
| created_at       | 2016-04-18T17:30:03.000000           |
| deleted          | False                                |
| deleted_at       | None                                 |
| disk_format      | qcow2                                |
| id               | 8061cbc8-fc49-4ae5-bd40-5f008fec8808 |
| is_public        | True                                 |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | ol66                                 |
| owner            | 529638a186034e5daa11dd831cd1c863     |
| protected        | False                                |
| size             | 370281984                            |
| status           | active                               |
| updated_at       | 2016-04-18T17:33:55.000000           |
| virtual_size     | None                                 |
+------------------+--------------------------------------+

Prism でも Image Configuration からイメージが確認できます。
Glance で指定した名前で登録されます。

f:id:gowatana:20160419030316p:plain

Netork サービス(Neutron)

ネットワークを「net01」という名前で作成してみます。

[root@ovm02 ~(keystone_admin)]# neutron net-create net01 --shared
Created a new network:
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | True                                 |
| id                        | dcb04863-99e1-4641-8945-9e126dfa294e |
| mtu                       | 0                                    |
| name                      | net01                                |
| provider:network_type     | vlan                                 |
| provider:physical_network | default                              |
| provider:segmentation_id  | 18                                   |
| router:external           | False                                |
| shared                    | True                                 |
| status                    | ACTIVE                               |
| subnets                   |                                      |
| tenant_id                 | 529638a186034e5daa11dd831cd1c863     |
+---------------------------+--------------------------------------+

「net01」に、サブネット「subnet01」を作成します。
エラーを避けるため、Gateway と DNS サーバのアドレスも指定します。

[root@ovm02 ~(keystone_admin)]# neutron subnet-create dcb04863-99e1-4641-8945-9e126dfa294e 192.168.10.0/24 \
> --name subnet01 \
> --enable_dhcp \
> --allocation-pool start=192.168.10.11,end=192.168.10.20 \
> --gateway=192.168.10.1 \
> --dns-nameserver=192.168.10.1
Created a new subnet:
+-------------------+----------------------------------------------------+
| Field             | Value                                              |
+-------------------+----------------------------------------------------+
| allocation_pools  | {"start": "192.168.10.11", "end": "192.168.10.20"} |
| cidr              | 192.168.10.0/24                                    |
| dns_nameservers   | 192.168.10.1                                       |
| enable_dhcp       | True                                               |
| gateway_ip        | 192.168.10.1                                       |
| host_routes       |                                                    |
| id                | fa75d30d-8670-4f74-a5d3-b3e0f225ebaa               |
| ip_version        | 4                                                  |
| ipv6_address_mode |                                                    |
| ipv6_ra_mode      |                                                    |
| name              | subnet01                                           |
| network_id        | dcb04863-99e1-4641-8945-9e126dfa294e               |
| subnetpool_id     |                                                    |
| tenant_id         | 529638a186034e5daa11dd831cd1c863                   |
+-------------------+----------------------------------------------------+

Prism から確認でも、ネットワークが追加されたことが確認できます。
ネットワーク名は空欄で、VLAN ID は自動採番です。

f:id:gowatana:20160419030524p:plain

ネットワークアドレス、デフォルトゲートウェイ、DNS サーバのアドレスが設定されています。

f:id:gowatana:20160419030703p:plain

IP アドレスプールも自動的に登録されます。
DHCP サーバの IP アドレスは、ネットワークアドレスの末尾になっています。

f:id:gowatana:20160419030730p:plain

Volume サービス(Cinder)

「vol01」という名前で、1GB のボリュームを作成します。

[root@ovm02 ~(keystone_admin)]# cinder create --display-name vol01 1
+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|     attachments     |                  []                  |
|  availability_zone  |                 nova                 |
|       bootable      |                false                 |
|      created_at     |      2016-04-18T17:44:51.310726      |
| display_description |                 None                 |
|     display_name    |                vol01                 |
|      encrypted      |                False                 |
|          id         | f8a7392f-6034-4518-bce1-001d68978a74 |
|       metadata      |                  {}                  |
|     multiattach     |                false                 |
|         size        |                  1                   |
|     snapshot_id     |                 None                 |
|     source_volid    |                 None                 |
|        status       |               creating               |
|     volume_type     |                 None                 |
+---------------------+--------------------------------------+

Prism で、指定どおり 1GB のボリュームグループとして作成されていることがわかります。Cinder で指定した名前がそのまま使用されています。

f:id:gowatana:20160419031017p:plain

Compute サービス(Nova)

Nova でインスタンス「vm01」を起動します。
これまで作成した Glance イメージ、Neutron ネットワークを指定します。

[root@ovm02 ~(keystone_admin)]# nova boot --flavor=1 --image=ol66 \
> --nic net-id=dcb04863-99e1-4641-8945-9e126dfa294e vm01
+--------------------------------------+---------------------------------------------+
| Property                             | Value                                       |
+--------------------------------------+---------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                      |
| OS-EXT-AZ:availability_zone          | nova                                        |
| OS-EXT-SRV-ATTR:host                 | -                                           |
| OS-EXT-SRV-ATTR:hypervisor_hostname  | -                                           |
| OS-EXT-SRV-ATTR:instance_name        | instance-00000009                           |
| OS-EXT-STS:power_state               | 0                                           |
| OS-EXT-STS:task_state                | scheduling                                  |
| OS-EXT-STS:vm_state                  | building                                    |
| OS-SRV-USG:launched_at               | -                                           |
| OS-SRV-USG:terminated_at             | -                                           |
| accessIPv4                           |                                             |
| accessIPv6                           |                                             |
| adminPass                            | q6i5Co9LQ2hF                                |
| config_drive                         |                                             |
| created                              | 2016-04-18T17:53:57Z                        |
| flavor                               | m1.tiny (1)                                 |
| hostId                               |                                             |
| id                                   | 497dc42b-f11b-4303-9ddd-d508fc2fa55d        |
| image                                | ol66 (8061cbc8-fc49-4ae5-bd40-5f008fec8808) |
| key_name                             | -                                           |
| metadata                             | {}                                          |
| name                                 | vm01                                        |
| os-extended-volumes:volumes_attached | []                                          |
| progress                             | 0                                           |
| security_groups                      | default                                     |
| status                               | BUILD                                       |
| tenant_id                            | 529638a186034e5daa11dd831cd1c863            |
| updated                              | 2016-04-18T17:53:57Z                        |
| user_id                              | 05d43262036849f1918b57de4802b823            |
+--------------------------------------+---------------------------------------------+

インスタンスが起動したら、作成した Cinder ボリュームを接続します。

[root@ovm02 ~(keystone_admin)]# nova volume-attach vm01 f8a7392f-6034-4518-bce1-001d68978a74
+----------+--------------------------------------+
| Property | Value                                |
+----------+--------------------------------------+
| device   | /dev/sdb                             |
| id       | f8a7392f-6034-4518-bce1-001d68978a74 |
| serverId | 497dc42b-f11b-4303-9ddd-d508fc2fa55d |
| volumeId | f8a7392f-6034-4518-bce1-001d68978a74 |
+----------+--------------------------------------+

Prism でも、neutron / cinder で作成したネットワークとボリュームに接続されたことが確認できます。

f:id:gowatana:20160419031355p:plain

以上。