openstack之nova
nova作为计算组件,在控制节点和计算节点都需要安装1、创建用户:nova,并授权用户权限
1
2
3
4
5
6
7
8
9
10
11
# source admin-openrc.sh
# openstack user create --domain default --password=nova nova
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 45524200648c4f11a87d06dcfb4383ed |
| name | nova |
+-----------+----------------------------------+
# openstack role add --project service --user nova admin
2、在keystone上面注册nova
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# openstack service create --name nova --description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Compute |
| enabled | True |
| id | 35c1b3343be94bbeafc4bf0e998ec8f5 |
| name | nova |
| type | compute |
+-------------+----------------------------------+
# openstack endpoint create --region RegionOne compute public http://172.16.80.130:8774/v2/%\(tenant_id\)s
+--------------+--------------------------------------------+
| Field | Value |
+--------------+--------------------------------------------+
| enabled | True |
| id | 7f317abd7f264109b318e567d068065f |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 35c1b3343be94bbeafc4bf0e998ec8f5 |
| service_name | nova |
| service_type | compute |
| url | http://172.16.80.130:8774/v2/%(tenant_id)s |
+--------------+--------------------------------------------+
# openstack endpoint create --region RegionOne compute admin http://172.16.80.130:8774/v2/%\(tenant_id\)s
+--------------+--------------------------------------------+
| Field | Value |
+--------------+--------------------------------------------+
| enabled | True |
| id | 8fb6e2da3c9c4bd0b3e2f787d40df4e0 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 35c1b3343be94bbeafc4bf0e998ec8f5 |
| service_name | nova |
| service_type | compute |
| url | http://172.16.80.130:8774/v2/%(tenant_id)s |
+--------------+--------------------------------------------+
# openstack endpoint create --region RegionOne compute internal http://172.16.80.130:8774/v2/%\(tenant_id\)s
+--------------+--------------------------------------------+
| Field | Value |
+--------------+--------------------------------------------+
| enabled | True |
| id | 3a4a8569cec949b5b50367d3deb67861 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 35c1b3343be94bbeafc4bf0e998ec8f5 |
| service_name | nova |
| service_type | compute |
| url | http://172.16.80.130:8774/v2/%(tenant_id)s |
+--------------+--------------------------------------------+
3、安装配置nova
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# yum install openstack-nova-api openstack-nova-cert openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-schedulerpython-novaclient-y
# grep -n "^"/etc/nova/nova.conf
198:my_ip=172.16.80.130
344:enabled_apis=osapi_compute,metadata
506:auth_strategy=keystone
838:network_api_class=nova.network.neutronv2.api.API
930:linuxnet_interface_driver=nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
1064:security_group_api=neutron
1240:firewall_driver=nova.virt.firewall.NoopFirewallDriver
1283:verbose=true
1422:rpc_backend=rabbit
1721:connection=mysql://nova:nova@172.16.80.130/nova
1944:host=$my_ip
2122:uth_uri = http://172.16.80.130:5000
2123:auth_url = http://172.16.80.130:35357
2124:auth_plugin = password
2125:project_domain_id = default
2126:user_domain_id = default
2127:project_name = service
2128:username = nova
2129:password = nova
2738:lock_path=/var/lib/nova/tmp
2881:rabbit_host=172.16.80.130
2882:rabbit_port=5672
2883:rabbit_userid=openstack
2884:rabbit_password=openstack
3309:vncserver_listen= $my_ip
3310:vncserver_proxyclient_address= $my_ip
4、同步数据库,检查结果
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# su -s /bin/sh -c "nova-manage db sync" nova
# mysql -e "use 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 |
+--------------------------------------------+
5、启动nova
1
2
3
4
5
6
7
8
# 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.
# 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
6、在计算节点上面操作
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# vim /etc/chrony.conf
server 172.16.80.130 iburst
# systemctl enable chronyd.service
# systemctl startchronyd.service
# timedatectl set-timezone Asia/Shanghai
# timedatectl status
Local time: Wed 2016-11-02 19:36:16 CST
Universal time: Wed 2016-11-02 11:36:16 UTC
RTC time: Wed 2016-11-02 11:36:16
Timezone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
7、安装nova组件并配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# yum install https://rdoproject.org/repos/openstack-liberty/rdo-release-liberty.rpm -y
# yum install centos-release-openstack-liberty -y
# yum install openstack-nova-compute sysfsutils -y
# grep -n '^' /etc/nova/nova.conf
198:my_ip=172.16.80.131
344:enabled_apis=osapi_compute,metadata
506:auth_strategy=keystone
838:network_api_class=nova.network.neutronv2.api.API
930:linuxnet_interface_driver=nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
1064:security_group_api=neutron
1240:firewall_driver=nova.virt.firewall.NoopFirewallDriver
1283:verbose=true
1422:rpc_backend=rabbit
1721:connection=mysql://nova:nova@172.16.80.130/nova
1944:host=172.16.80.130
2122:uth_uri = http://172.16.80.130:5000
2123:auth_url = http://172.16.80.130:35357
2124:auth_plugin = password
2125:project_domain_id = default
2126:user_domain_id = default
2127:project_name = service
2128:username = nova
2129:password = nova
2309:virt_type=kvm
2738:lock_path=/var/lib/nova/tmp
2881:rabbit_host=172.16.80.130
2882:rabbit_port=5672
2883:rabbit_userid=openstack
2884:rabbit_password=openstack
3309:novncproxy_base_url=http://172.16.80.130:6080/vnc_auto.html
3311:vncserver_listen= 0.0.0.0
3312:vncserver_proxyclient_address= $my_ip
3313:vnc_enabled=true
8、启动
1
2
3
# systemctl enable libvirtd openstack-nova-compute
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-compute.service to /usr/lib/systemd/system/openstack-nova-compute.service.
# systemctl start libvirtd openstack-nova-compute
9、在控制节点上面进行验证
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# source admin-openrc.sh
# nova image-list
+--------------------------------------+--------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+--------+--------+--------+
| 6772deca-7b31-4f97-affa-668518b22972 | cirros | ACTIVE | |
+--------------------------------------+--------+--------+--------+
#
# nova endpoints
WARNING: nova has no endpoint in ! Available endpoints for this service:
+-----------+---------------------------------------------------------------+
| nova | Value |
+-----------+---------------------------------------------------------------+
| id | 3a4a8569cec949b5b50367d3deb67861 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.16.80.130:8774/v2/8a3b7f9f1b2c4f7eaf7780d268e672d1 |
+-----------+---------------------------------------------------------------+
+-----------+---------------------------------------------------------------+
| nova | Value |
+-----------+---------------------------------------------------------------+
| id | 7f317abd7f264109b318e567d068065f |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.16.80.130:8774/v2/8a3b7f9f1b2c4f7eaf7780d268e672d1 |
+-----------+---------------------------------------------------------------+
+-----------+---------------------------------------------------------------+
| nova | Value |
+-----------+---------------------------------------------------------------+
| id | 8fb6e2da3c9c4bd0b3e2f787d40df4e0 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.16.80.130:8774/v2/8a3b7f9f1b2c4f7eaf7780d268e672d1 |
+-----------+---------------------------------------------------------------+
WARNING: glance has no endpoint in ! Available endpoints for this service:
+-----------+----------------------------------+
| glance | Value |
+-----------+----------------------------------+
| id | 03cbb947b93e43ea936ee6c54db63275 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.16.80.130:9292 |
+-----------+----------------------------------+
+-----------+----------------------------------+
| glance | Value |
+-----------+----------------------------------+
| id | 6a716435ec7b4d7b8593f02a4bd89a57 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.16.80.130:9292 |
+-----------+----------------------------------+
+-----------+----------------------------------+
| glance | Value |
+-----------+----------------------------------+
| id | fcf98c96b25d4da5a1bf68ffafeaf832 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.16.80.130:9292 |
+-----------+----------------------------------+
WARNING: keystone has no endpoint in ! Available endpoints for this service:
+-----------+----------------------------------+
| keystone| Value |
+-----------+----------------------------------+
| id | 09a1cd321fd64049980096e7a940f6f8 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.16.80.130:5000/v2.0 |
+-----------+----------------------------------+
+-----------+----------------------------------+
| keystone| Value |
+-----------+----------------------------------+
| id | 0c199cc25852452d8b4a428edd4af515 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.16.80.130:5000/v2.0 |
+-----------+----------------------------------+
+-----------+----------------------------------+
| keystone| Value |
+-----------+----------------------------------+
| id | 1b875e33729a4ea4aa9f1e3f5d28bfd1 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| url | http://172.16.80.130:35357/v2.0|
+-----------+----------------------------------+
#
# nova service-list
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary | Host | Zone | Status| State | Updated_at | Disabled Reason |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| 1| nova-conductor | controller | internal | enabled | up | 2016-11-02T12:27:09.000000 | - |
| 2| nova-consoleauth | controller | internal | enabled | up | 2016-11-02T12:27:09.000000 | - |
| 3| nova-scheduler | controller | internal | enabled | up | 2016-11-02T12:27:08.000000 | - |
| 4| nova-cert | controller | internal | enabled | up | 2016-11-02T12:27:09.000000 | - |
| 5| nova-compute | computer1| nova | enabled | up | 2016-11-02T12:27:12.000000 | - |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
页:
[1]