openstack 管理三十一 - rpm 方式部署 openstack [nova]

简介: 作用1 响应云主机请求, 并把连接调度至对应的 compute 节点2 提供 console 认证服务3 提供 vnc 访问云主机功能软件安装# yum install -y openstack-nova-api openstack-nova-compute openstack-nova-conductor openstack-nova-scheduler

作用

1 响应云主机请求, 并把连接调度至对应的 compute 节点
2 提供 console 认证服务
3 提供 vnc 访问云主机功能

软件安装

# yum install -y openstack-nova-api openstack-nova-compute openstack-nova-conductor openstack-nova-scheduler python-cinderclient openstack-utils openstack-nova-novncproxy  openstack-nova-console

配置 vnc 服务

# openstack-config --set /etc/nova/nova.conf DEFAULT openstack-config --set /etc/nova/nova.conf DEFAULT xvpvncproxy_base_url http://0.0.0.0:6081/console
# openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 0.0.0.0
# openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 0.0.0.0
# openstack-config --set /etc/nova/nova.conf DEFAULT vnc_enabled true
# openstack-config --set /etc/nova/nova.conf DEFAULT vpvncproxy_port 6081
# openstack-config --set /etc/nova/nova.conf DEFAULT xvpvncproxy_host 0.0.0.0
# openstack-config --set /etc/nova/nova.conf DEFAULT novncproxy_host=0.0.0.0
# openstack-config --set /etc/nova/nova.conf DEFAULT novncproxy_port=6080

配置 keystone 验证

# openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_host 240.10.130.25
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_port 35357
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_protocol http
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://240.10.130.25:5000/
# openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_user nova
# openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_password nova
# openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_tenant_name service
# openstack-config --set /etc/nova/api-paste.ini filter:authtoken auth_host 240.10.130.25
# openstack-config --set /etc/nova/api-paste.ini filter:authtoken admin_tenant_name service
# openstack-config --set /etc/nova/api-paste.ini filter:authtoken admin_user nova
# openstack-config --set /etc/nova/api-paste.ini filter:authtoken admin_password nova
# openstack-config --set /etc/nova/api-paste.ini filter:authtoken paste.filter_factory keystoneclient.middleware.auth_token:filter_factory

nova 连接 glance

# openstack-config --set /etc/nova/nova.conf DEFAULT glance_host 10.199.130.25
# openstack-config --set /etc/nova/nova.conf DEFAULT glance_port 9292
# openstack-config --set /etc/nova/nova.conf DEFAULT glance_protocol http
# openstack-config --set /etc/nova/nova.conf DEFAULT glance_api_servers 10.199.130.25:9292
# openstack-config --set /etc/nova/nova.conf DEFAULT image_service nova.image.glance.GlanceImageService

nova 连接 rabbitmq

# openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend rabbit
# openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_host 240.10.130.25
# openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_port 5672
# openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_userid nova
# openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_password openstack

设定虚拟云主机超配

# openstack-config --set /etc/nova/nova.conf DEFAULT cpu_allocation_ratio=16.0
# openstack-config --set /etc/nova/nova.conf DEFAULT ram_allocation_ratio=1.5
# openstack-config --set /etc/nova/nova.conf DEFAULT reserved_host_memory_mb=1024
# openstack-config --set /etc/nova/nova.conf DEFAULT reserved_host_disk_mb=0

nova 节点启用 metadata-proxy 连接 metadata

# openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis ec2,osapi_compute,metadata
# openstack-config --set /etc/nova/nova.conf DEFAULT metadata_listen 0.0.0.0
# openstack-config --set /etc/nova/nova.conf DEFAULT metadata_workers 24
# openstack-config --set /etc/nova/nova.conf DEFAULT rootwrap_config /etc/nova/rootwrap.conf
# openstack-config --set /etc/nova/nova.conf DEFAULT use_forwarded_for False
# openstack-config --set /etc/nova/nova.conf DEFAULT service_neutron_metadata_proxy True
# openstack-config --set /etc/nova/nova.conf DEFAULT neutron_metadata_proxy_shared_secret 744ee65672684281
# openstack-config --set /etc/nova/nova.conf DEFAULT neutron_default_tenant_id default
# openstack-config --set /etc/nova/nova.conf DEFAULT metadata_host 240.10.130.30

nova 连接 neutron

# openstack-config --set /etc/nova/nova.conf DEFAULT network_api_class nova.network.neutronv2.api.API
# openstack-config --set /etc/nova/nova.conf DEFAULT neutron_url http://240.10.130.29:9696/
# openstack-config --set /etc/nova/nova.conf DEFAULT neutron_admin_tenant_name service
# openstack-config --set /etc/nova/nova.conf DEFAULT neutron_admin_username neutron
# openstack-config --set /etc/nova/nova.conf DEFAULT neutron_admin_password neutron
# openstack-config --set /etc/nova/nova.conf DEFAULT neutron_admin_auth_url http://240.10.130.25:35357/v2.0
# openstack-config --set /etc/nova/nova.conf DEFAULT security_group_api neutron
# openstack-config --set /etc/nova/nova.conf DEFAULT firewall_drivernova.virt.firewall.NoopFirewallDriver

指定 libvirt 连接驱动

openstack-config --set /etc/nova/nova.conf libvirt vif_driver nova.virt.libvirt.vif.LibvirtGenericVIFDriver

支持 ovs 网络 plugin

openstack-config --set /etc/nova/nova.conf libvirt vif_driver nova.virt.libvirt.vif.LibvirtGenericVIFDriver

nova 连接 db

openstack-config --set /etc/nova/nova.conf DEFAULT sql_connection mysql://nova:openstack@240.10.130.25/nova

初始化数据

当数据库配置成功, 则下面命令能够在数据库上产生 108 个表

sudo -u nova nova-manage db sync

服务启动

# service openstack-nova-consoleauth restart
# service openstack-nova-novncproxy restart
# service messagebus restart
# service libvirtd restart
# service openstack-nova-api restart
# service openstack-nova-scheduler restart
# service openstack-nova-conductor restart

创建防火墙

[root@hh-yun-compute-130025 ~(keystone_admin)]# nova agent-list
+----------+------------+----+--------------+---------+---------+-----+
| Agent_id | Hypervisor | OS | Architecture | Version | Md5hash | Url |
+----------+------------+----+--------------+---------+---------+-----+
+----------+------------+----+--------------+---------+---------+-----+

检测服务状态

[root@hh-yun-compute-130025 ~(keystone_admin)]# nova service-list
+------------------+-----------------------------------+----------+---------+-------+----------------------------+-----------------+
| Binary           | Host                              | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+------------------+-----------------------------------+----------+---------+-------+----------------------------+-----------------+
| nova-consoleauth | hh-yun-compute-130030.vclound.com | internal | enabled | up    | 2014-10-11T02:36:15.000000 | -               |
| nova-scheduler   | hh-yun-compute-130030.vclound.com | internal | enabled | up    | 2014-10-11T02:36:16.000000 | -               |
| nova-conductor   | hh-yun-compute-130030.vclound.com | internal | enabled | up    | 2014-10-11T02:36:16.000000 | -               |
| nova-compute     | hh-yun-compute-130030.vclound.com | nova     | disabled| down  | 2014-10-11T02:36:16.000000 | -               |
+------------------+-----------------------------------+----------+---------+-------+----------------------------+-----------------+

检测网络

[root@hh-yun-compute-130025 ~(keystone_admin)]# nova network-list
+--------------------------------------+---------+------+
| ID                                   | Label   | Cidr |
+--------------------------------------+---------+------+
| b26b81fc-bda9-4882-950c-614e9546bcd1 | ext_net | -    |
+--------------------------------------+---------+------+

检测安全组

[root@hh-yun-compute-130025 ~(keystone_admin)]# nova secgroup-list
+--------------------------------------+---------+-------------+
| Id                                   | Name    | Description |
+--------------------------------------+---------+-------------+
| 9caa0d6f-c063-46f9-ab3b-845962ac836b | default | default     |
+--------------------------------------+---------+-------------+

检测规则

[root@hh-yun-compute-130025 ~(keystone_admin)]# nova secgroup-list-rules default
+-------------+-----------+---------+-----------+--------------+
| IP Protocol | From Port | To Port | IP Range  | Source Group |
+-------------+-----------+---------+-----------+--------------+
|             |           |         |           | default      |
|             |           |         |           | default      |
+-------------+-----------+---------+-----------+--------------+

为 default 安全组加添规则

# nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0 > /dev/null
# nova secgroup-add-rule default tcp  22 22 0.0.0.0/0 > /dev/null
# nova secgroup-add-rule default udp 53 53 0.0.0.0/0 > /dev/null

验证

[root@hh-yun-compute-130025 ~(keystone_admin)]# nova secgroup-list-rules default
+-------------+-----------+---------+-----------+--------------+
| IP Protocol | From Port | To Port | IP Range  | Source Group |
+-------------+-----------+---------+-----------+--------------+
| icmp        | -1        | -1      | 0.0.0.0/0 |              |
|             |           |         |           | default      |
| tcp         | 22        | 22      | 0.0.0.0/0 |              |
| udp         | 53        | 53      | 0.0.0.0/0 |              |
|             |           |         |           | default      |
+-------------+-----------+---------+-----------+--------------+

创建新的安全组

# nova secgroup-create terry_test_rule "allow ping and ssh" > /dev/null
# nova secgroup-add-rule terry_test_rule icmp -1 -1 0.0.0.0/0 > /dev/null
# nova secgroup-add-rule terry_test_rule tcp  22 22 0.0.0.0/0 > /dev/null
# nova secgroup-add-rule terry_test_rule udp 53 53 0.0.0.0/0 > /dev/null

验证

[root@hh-yun-compute-130025 ~(keystone_admin)]# nova secgroup-list-rules terry_test_rule
+-------------+-----------+---------+-----------+--------------+
| IP Protocol | From Port | To Port | IP Range  | Source Group |
+-------------+-----------+---------+-----------+--------------+
| icmp        | -1        | -1      | 0.0.0.0/0 |              |
| udp         | 53        | 53      | 0.0.0.0/0 |              |
| tcp         | 22        | 22      | 0.0.0.0/0 |              |
+-------------+-----------+---------+-----------+--------------+
目录
相关文章
|
4月前
|
存储 API 调度
OpenStack的计算服务(Nova)
【8月更文挑战第23天】
339 9
|
4月前
|
消息中间件 缓存 Shell
跟我一起来学OpenStack部署
跟我一起来学OpenStack部署
354 0
|
4月前
|
API 调度 数据库
OpenStack核心组件Nova
【8月更文挑战第4天】
240 9
|
5月前
|
存储 数据安全/隐私保护 Docker
Kolla-ansible部署openStack
Kolla-ansible部署openStack
480 11
|
7月前
|
Linux 网络安全 API
云计算|OpenStack|社区版OpenStack安装部署文档(五 --- 计算服务nova安装部署---Rocky版)
云计算|OpenStack|社区版OpenStack安装部署文档(五 --- 计算服务nova安装部署---Rocky版)
398 0
|
7月前
|
Linux 网络安全 数据库
openstack 部署单节点
在CentOS 7系统上,配置了一台拥有4核CPU、8GB内存和300GB磁盘的服务器,安装了OpenStack Trian版本。安装完成后,获取了OpenStack管理控制台的登录凭证(admin用户和密码),可访问IP地址192.168.200.249/dashboard进行登录。如果遇到问题,可能需要重新安装以确保纯净环境。
344 0
|
7月前
|
存储 Ubuntu KVM
Ubuntu部署OpenStack踩坑指南:还要看系统版本?
Ubuntu部署OpenStack踩坑指南:还要看系统版本?
Ubuntu部署OpenStack踩坑指南:还要看系统版本?
|
7月前
|
存储 安全 Linux
云计算|OpenStack|社区版OpenStack安装部署文档(一 --- 前期硬件准备和部署规划)
云计算|OpenStack|社区版OpenStack安装部署文档(一 --- 前期硬件准备和部署规划)
1471 0
|
网络协议 Linux 网络安全
openstack 云平台一体化部署(超详细)
openstack 云平台一体化部署(超详细)
1353 0
openstack 云平台一体化部署(超详细)
|
存储 弹性计算 资源调度
openstack组件部署 3
openstack组件部署
161 0