OpenStack-liberty版Nova制御ノードサービス導入(三)
Novaコンピューティングサービス:API:外部リクエストの受信と応答を担当します.OpenStack API、EC 2 APIをサポートします.Cert:認証を担当します.Scheduler:ホストのスケジュールに使用します.Conductor:ノードがデータにアクセスするミドルウェアを計算します.Consoleauth:コンソールの認証に使用します.Novncproxy:VNCエージェント.
Nova API:nova-apiコンポーネントはRESTful API機能を実現し、外部からNovaにアクセスする唯一の方法である.外部からのリクエストを受信し、Message Queueを介して他のサービスコンポーネントにリクエストを送信するとともに、EC 2 APIにも対応しているので、EC 2の管理ツールでnovaを日常的に管理することもできます.
Nova scheduler:Nova Schedulerモジュールのopenstackでの役割は、仮想マシンがどのホスト(コンピューティングノード)に作成されるかを決定することです.仮想マシンが物理ノードにスケジューリングされるべきであることを決定するには、フィルタ(Filter)計算ウェイト値(Weight)の2つのステップが必要です.
Nova Dashboard:Filter Schedulterまずフィルタされていないホストのリストを取得し、次にフィルタ属性に基づいてサービス条件の計算ノードホストを選択します.
ホストのフィルタリング後、作成する仮想マシンごとに、ポリシーに基づいて適切なホストを選択するために、ホストの重み計算が必要です.
Novaインストール:
同期データベース:
novaユーザーの作成:
novaをサービスプロジェクトに追加してadmin権限を付与する.
network_api_class対応pythonメソッドディレクトリ;
linuxnet_interface_driverに対応するpythonメソッドディレクトリ;
novaを起動するには:
登録nova:
パブリックネットワークの登録:
プライベートネットワークの登録:
登録admin:
転載先:https://blog.51cto.com/smoke520/2294329
Nova API:nova-apiコンポーネントはRESTful API機能を実現し、外部からNovaにアクセスする唯一の方法である.外部からのリクエストを受信し、Message Queueを介して他のサービスコンポーネントにリクエストを送信するとともに、EC 2 APIにも対応しているので、EC 2の管理ツールでnovaを日常的に管理することもできます.
Nova scheduler:Nova Schedulerモジュールのopenstackでの役割は、仮想マシンがどのホスト(コンピューティングノード)に作成されるかを決定することです.仮想マシンが物理ノードにスケジューリングされるべきであることを決定するには、フィルタ(Filter)計算ウェイト値(Weight)の2つのステップが必要です.
Nova Dashboard:Filter Schedulterまずフィルタされていないホストのリストを取得し、次にフィルタ属性に基づいてサービス条件の計算ノードホストを選択します.
ホストのフィルタリング後、作成する仮想マシンごとに、ポリシーに基づいて適切なホストを選択するために、ホストの重み計算が必要です.
Novaインストール:
[root@hostnamelinux-node1 ~]# yum -y install openstack-nova-api openstack-nova-cert openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler python-novaclient
nova:
[root@hostnamelinux-node1 ~]# vim /etc/nova/nova.conf
[database]
connection=mysql://nova:[email protected]/nova
同期データベース:
[root@hostnamelinux-node1 ~]# su -s /bin/sh -c "nova-manage db sync" nova
[root@hostnamelinux-node1 ~]# mysql -unova -pnova
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 26
Server version: 10.1.20-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> use nova;
Database changed
MariaDB [nova]> show tables;
+--------------------------------------------+
| Tables_in_nova |
+--------------------------------------------+
| agent_builds |
| aggregate_hosts |
| aggregate_metadata |
| aggregates |
| block_device_mapping |
| bw_usage_cache |
| cells |
| certificates |
| compute_nodes |
| console_pools |
| consoles |
| dns_domains |
| fixed_ips |
| floating_ips |
| instance_actions |
| instance_actions_events |
| instance_extra |
| instance_faults |
| instance_group_member |
| instance_group_policy |
| instance_groups |
| instance_id_mappings |
| instance_info_caches |
| instance_metadata |
| instance_system_metadata |
| instance_type_extra_specs |
| instance_type_projects |
| instance_types |
| instances |
| key_pairs |
| migrate_version |
| migrations |
| networks |
| pci_devices |
| project_user_quotas |
| provider_fw_rules |
| quota_classes |
| quota_usages |
| quotas |
| reservations |
| s3_images |
| security_group_default_rules |
| security_group_instance_association |
| security_group_rules |
| security_groups |
| services |
| shadow_agent_builds |
| shadow_aggregate_hosts |
| shadow_aggregate_metadata |
| shadow_aggregates |
| shadow_block_device_mapping |
| shadow_bw_usage_cache |
| shadow_cells |
| shadow_certificates |
| shadow_compute_nodes |
| shadow_console_pools |
| shadow_consoles |
| shadow_dns_domains |
| shadow_fixed_ips |
| shadow_floating_ips |
| shadow_instance_actions |
| shadow_instance_actions_events |
| shadow_instance_extra |
| shadow_instance_faults |
| shadow_instance_group_member |
| shadow_instance_group_policy |
| shadow_instance_groups |
| shadow_instance_id_mappings |
| shadow_instance_info_caches |
| shadow_instance_metadata |
| shadow_instance_system_metadata |
| shadow_instance_type_extra_specs |
| shadow_instance_type_projects |
| shadow_instance_types |
| shadow_instances |
| shadow_key_pairs |
| shadow_migrate_version |
| shadow_migrations |
| shadow_networks |
| shadow_pci_devices |
| shadow_project_user_quotas |
| shadow_provider_fw_rules |
| shadow_quota_classes |
| shadow_quota_usages |
| shadow_quotas |
| shadow_reservations |
| shadow_s3_images |
| shadow_security_group_default_rules |
| shadow_security_group_instance_association |
| shadow_security_group_rules |
| shadow_security_groups |
| shadow_services |
| shadow_snapshot_id_mappings |
| shadow_snapshots |
| shadow_task_log |
| shadow_virtual_interfaces |
| shadow_volume_id_mappings |
| shadow_volume_usage_cache |
| snapshot_id_mappings |
| snapshots |
| tags |
| task_log |
| virtual_interfaces |
| volume_id_mappings |
| volume_usage_cache |
+--------------------------------------------+
105 rows in set (0.01 sec)
MariaDB [nova]> exit
Bye
[root@hostnamelinux-node1 ~]# vim /etc/nova/nova.conf
[DEFAULT]
rpc_backend=rabbit
[oslo_messaging_rabbit]
rabbit_host=192.168.56.11
rabbit_port=5672
rabbit_userid=openstack
rabbit_password=openstack
novaユーザーの作成:
[root@hostnamelinux-node1 ~]# openstack user create --domain default --password=nova nova
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 8120acc4fbbb4cc3a86b20f5ac6114c9 |
| name | nova |
+-----------+----------------------------------+
novaをサービスプロジェクトに追加してadmin権限を付与する.
[root@hostnamelinux-node1 ~]# openstack role add --project service --user nova admin
[root@hostnamelinux-node1 ~]# vim /etc/nova/nova.conf
[keystone_authtoken]
auth_uri = http://192.168.56.11:5000
auth_url = http://192.168.56.11:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = nova
[DEFAULT]
auth_strategy=keystone
network_api_class=nova.network.neutronv2.api.API
network_api_class対応pythonメソッドディレクトリ;
[root@hostnamelinux-node1 ~]# vim /usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py
class API(base_api.NetworkAPI):
pass
[root@hostnamelinux-node1 ~]# vim /etc/nova/nova.conf
[DEFAULT]
security_group_api=neutron
linuxnet_interface_driver=nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
linuxnet_interface_driverに対応するpythonメソッドディレクトリ;
[root@hostnamelinux-node1 ~]# vim /usr/lib/python2.7/site-packages/nova/network/linux_net.py
class NeutronLinuxBridgeInterfaceDriver(LinuxNetInterfaceDriver):
pass
[root@hostnamelinux-node1 ~]# vim /etc/nova/nova.conf
[DEFAULT]
#firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver
firewall_driver=nova.virt.firewall.NoopFirewallDriver
my_ip=192.168.56.11
enabled_apis=osapi_compute,metadata
[vnc]
vncserver_listen=$my_ip
vncserver_proxyclient_address=$my_ip
[glance]
host=$my_ip
[oslo_concurrency]
lock_path=/var/lib/nova/tmp
[root@hostnamelinux-node1 ~]# grep '^[a-z]' /etc/nova/nova.conf
my_ip=192.168.56.11
enabled_apis=osapi_compute,metadata
auth_strategy=keystone
network_api_class=nova.network.neutronv2.api.API
linuxnet_interface_driver=nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
security_group_api=neutron
firewall_driver=nova.virt.firewall.NoopFirewallDriver
rpc_backend=rabbit
connection=mysql://nova:[email protected]/nova
host=$my_ip
auth_uri = http://192.168.56.11:5000
auth_url = http://192.168.56.11:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = nova
lock_path=/var/lib/nova/tmp
rabbit_host=192.168.56.11
rabbit_port=5672
rabbit_userid=openstack
rabbit_password=openstack
vncserver_listen=$my_ip
vncserver_proxyclient_address=$my_ip
novaを起動するには:
[root@hostnamelinux-node1 ~]# grep '^[a-z]' /etc/nova/nova.conf -c
25
[root@hostnamelinux-node1 ~]# systemctl enable openstack-nova-api.service \
openstack-nova-cert.service openstack-nova-consoleauth.service \
openstack-nova-scheduler.service openstack-nova-conductor.service \
openstack-nova-novncproxy.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-api.service to /usr/lib/systemd/system/openstack-nova-api.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-cert.service to /usr/lib/systemd/system/openstack-nova-cert.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-consoleauth.service to /usr/lib/systemd/system/openstack-nova-consoleauth.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-scheduler.service to /usr/lib/systemd/system/openstack-nova-scheduler.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-conductor.service to /usr/lib/systemd/system/openstack-nova-conductor.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-novncproxy.service to /usr/lib/systemd/system/openstack-nova-novncproxy.service.
[root@hostnamelinux-node1 ~]# systemctl start openstack-nova-api.service \
openstack-nova-cert.service openstack-nova-consoleauth.service \
openstack-nova-scheduler.service openstack-nova-conductor.service \
openstack-nova-novncproxy.service
登録nova:
[root@hostnamelinux-node1 ~]# source admin-openrc.sh
novaサービスの作成:[root@hostnamelinux-node1 ~]# openstack service create --name nova --description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Compute |
| enabled | True |
| id | 887fca219f71485a96461ad96aabc594 |
| name | nova |
| type | compute |
+-------------+----------------------------------+
パブリックネットワークの登録:
[root@hostnamelinux-node1 ~]# openstack endpoint create --region RegionOne compute public http://192.168.56.11:8774/v2/%\(tenant_id\)s
+--------------+--------------------------------------------+
| Field | Value |
+--------------+--------------------------------------------+
| enabled | True |
| id | aacb15c952264c478632facc9953f320 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 887fca219f71485a96461ad96aabc594 |
| service_name | nova |
| service_type | compute |
| url | http://192.168.56.11:8774/v2/%(tenant_id)s |
+--------------+--------------------------------------------+
プライベートネットワークの登録:
[root@hostnamelinux-node1 ~]# openstack endpoint create --region RegionOne compute internal http://192.168.56.11:8774/v2/%\(tenant_id\)s
+--------------+--------------------------------------------+
| Field | Value |
+--------------+--------------------------------------------+
| enabled | True |
| id | 0c5bb8ed04ff4e30bff474ab693a8e7b |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 887fca219f71485a96461ad96aabc594 |
| service_name | nova |
| service_type | compute |
| url | http://192.168.56.11:8774/v2/%(tenant_id)s |
+--------------+--------------------------------------------+
登録admin:
[root@hostnamelinux-node1 ~]# openstack endpoint create --region RegionOne compute admin http://192.168.56.11:8774/v2/%\(tenant_id\)s
+--------------+--------------------------------------------+
| Field | Value |
+--------------+--------------------------------------------+
| enabled | True |
| id | be2392a0d3a84014b108fda8fe9c08eb |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 887fca219f71485a96461ad96aabc594 |
| service_name | nova |
| service_type | compute |
| url | http://192.168.56.11:8774/v2/%(tenant_id)s |
+--------------+--------------------------------------------+
[root@hostnamelinux-node1 ~]# openstack host list
+-------------------------------+-------------+----------+
| Host Name | Service | Zone |
+-------------------------------+-------------+----------+
| hostnamelinux-node1.smoke.com | scheduler | internal |
| hostnamelinux-node1.smoke.com | cert | internal |
| hostnamelinux-node1.smoke.com | consoleauth | internal |
| hostnamelinux-node1.smoke.com | conductor | internal |
+-------------------------------+-------------+----------+
転載先:https://blog.51cto.com/smoke520/2294329