上一篇介绍了glance,并且成功创建了一个镜像,这一篇介绍Nova。

  • 首先创建Nova用户,需要记得先source环境变量,然后创建Nova用户,并设置密码为nova
[root@linux-node1 ~]# source admin-openstack.sh
[root@linux-node1 ~]# openstack user create --domain default --password-
prompt nova
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 34c7be4d612a45b4830304af29eb010e |
| name | nova |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
  • 给Nova用户添加admin角色
[root@linux-node1 ~]# openstack role add --project service --user nova admin
[root@linux-node1 ~]#
  • 创建Nova服务实例
openstack service create --name nova \
--description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Compute |
| enabled | True |
| id | bf254b3182e04256897e925632f171d0 |
| name | nova |
| type | compute |
+-------------+----------------------------------+
  • 创建NovaAPI服务端点
openstack endpoint create --region RegionOne \
compute public http://192.168.56.11:8774/v2.1

+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 06541267fb014c7f9b0be6748366fdba |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | bf254b3182e04256897e925632f171d0 |
| service_name | nova |
| service_type | compute |
| url | http://192.168.56.11:8774/v2.1 |
+--------------+----------------------------------+openstack endpoint create --region RegionOne \
compute internal http://192.168.56.11:8774/v2.1

+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | d9da327e665645fb9766dea107e13bf1 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | bf254b3182e04256897e925632f171d0 |
| service_name | nova |
| service_type | compute |
| url | http://192.168.56.11:8774/v2.1 |
+--------------+----------------------------------+openstack endpoint create --region RegionOne \
compute admin http://192.168.56.11:8774/v2.1

+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 805cd45ded6841d0acd3335ccfdc29ef |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | bf254b3182e04256897e925632f171d0 |
| service_name | nova |
| service_type | compute |
| url | http://192.168.56.11:8774/v2.1 |
+--------------+----------------------------------+
  • 创建placement服务,并将密码设置为placement
[root@linux-node1 ~]# openstack user create --domain default --password-prompt placement
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 27080769990347169fdc6bf81fe9ebd1 |
| name | placement |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
  • 给placement用户添加admin角色
[root@linux-node1 ~]# openstack role add --project service --user placement admin
  • 在服务目录中创建placement API实例
[root@linux-node1 ~]# openstack service create --name placement --description "Placement API" placement
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | Placement API |
| enabled | True |
| id | 344d25c79f1b412cb0c5958bd8242b2c |
| name | placement |
| type | placement |
+-------------+----------------------------------+
  • 创建placement API 服务端点
[root@linux-node1 ~]# openstack endpoint create --region RegionOne placement public http://192.168.56.11:8778
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | a70af939c7ed4d899da5675ade2b3a33 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 344d25c79f1b412cb0c5958bd8242b2c |
| service_name | placement |
| service_type | placement |
| url | http://192.168.56.11:8778 |
+--------------+----------------------------------+
[root@linux-node1 ~]# openstack endpoint create --region RegionOne placement internal http://192.168.56.11:877
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | cfb1efaae8bd4022b4d0b8aebb286935 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 344d25c79f1b412cb0c5958bd8242b2c |
| service_name | placement |
| service_type | placement |
| url | http://192.168.56.11:8778 |
+--------------+----------------------------------+
[root@linux-node1 ~]# openstack endpoint create --region RegionOne placement admin http://192.168.56.11:8778
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 48718fc25ef344b2a20622d091387f9c |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 344d25c79f1b412cb0c5958bd8242b2c |
| service_name | placement |
| service_type | placement |
| url | http://192.168.56.11:8778 |
+--------------+----------------------------------+
  • 验证Nova与placement服务是否创建
[root@linux-node1 ~]# openstack endpoint list
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
| 06541267fb014c7f9b0be6748366fdba | RegionOne | nova | compute | True | public | http://192.168.56.11:8774/v2.1 |
| 16964c23761c428b909e9a8617d8146e | RegionOne | keystone | identity | True | internal | http://192.168.56.11:5000/v3/ |
| 223775040aaf460da4f275ebbcd01ae1 | RegionOne | glance | image | True | admin | http://192.168.56.11:9292 |
| 36fb4b5b955d471783a982ea455cf58d | RegionOne | keystone | identity | True | public | http://192.168.56.11:5000/v3/ |
| 47e8d9659f70422487cf600405f518bf | RegionOne | glance | image | True | public | http://192.168.56.11:9292 |
| 48718fc25ef344b2a20622d091387f9c | RegionOne | placement | placement | True | admin | http://192.168.56.11:8778 |
| 62766176a40f43bbbb40d4b986b4400e | RegionOne | keystone | identity | True | admin | http://192.168.56.11:35357/v3/ |
| 805cd45ded6841d0acd3335ccfdc29ef | RegionOne | nova | compute | True | admin | http://192.168.56.11:8774/v2.1 |
| 859936e9632642d58517d9ac6a2c3176 | RegionOne | glance | image | True | internal | http://192.168.56.11:9292 |
| a70af939c7ed4d899da5675ade2b3a33 | RegionOne | placement | placement | True | public | http://192.168.56.11:8778 |
| cfb1efaae8bd4022b4d0b8aebb286935 | RegionOne | placement | placement | True | internal | http://192.168.56.11:8778 |
| d9da327e665645fb9766dea107e13bf1 | RegionOne | nova | compute | True | internal | http://192.168.56.11:8774/v2.1 |
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
  • 编辑/etc/nova/nova.conf,并做如下修改
[DEFAULT]
enabled_apis=osapi_compute,metadata 
transport_url=rabbit://openstack:openstack@192.168.56.11
my_ip = 192.168.56.11
use_neutron=true
firewall_driver=nova.virt.firewall.NoopFirewallDriver
[api]
auth_strategy=keystone 
[api_database]
connection=mysql+pymysql://nova:nova@192.168.56.11/nova_api 
[database]
connection=mysql+pymysql://nova:nova@192.168.56.11/nova 
[glance]
api_servers=192.168.56.11: 
[keystone_authtoken]

auth_uri = http://192.168.56.11:5000 
auth_url = http://192.168.56.11:35357 
memcached_servers = 192.168.56.11:
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
[placement]
os_region_name = RegionOne 
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://192.168.56.11:35357/v3
username = placement
password = placement
[vnc]
enabled=true
vncserver_listen=192.168.56.11
vncserver_proxyclient_address=192.168.56.11
[oslo_concurrency]
lock_path=/var/lib/nova/tmp 
  • 因为一个packaging bug,必须通过在/etc/httpd/conf.d/00-nova-placement-api.conf添加如下配置来是能placement API的接入:
<Directory /usr/bin>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
</Directory>
  • 重启httpd服务
# systemctl restart httpd
  • 同步nova-api数据库:
[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage api_db sync" nova
[root@linux-node1 ~]#
  • 登记cell0数据库
[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
[root@linux-node1 ~]#
  • 创建cell1
[root@linux-node1 ~]# nova-manage cell_v2 list_cells
+-------+--------------------------------------+---------------------------------------+----------------------------------------------------+
| Name | UUID | Transport URL | Database Connection |
+-------+--------------------------------------+---------------------------------------+----------------------------------------------------+
| cell0 | ---- | none:/ | mysql+pymysql://nova:****@192.168.56.11/nova_cell0 |
| cell1 | 9f317433-ab20---a9faa94d5825 | rabbit://openstack:****@192.168.56.11 | mysql+pymysql://nova:****@192.168.56.11/nova |
+-------+--------------------------------------+---------------------------------------+----------------------------------------------------+
[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
9f317433-ab20---a9faa94d5825
[root@linux-node1 ~]#
  • 同步Nova数据库
[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage db sync" nova
/usr/lib/python2./site-packages/pymysql/cursors.py:: Warning: (,
u'Duplicate index
`block_device_mapping_instance_uuid_virtual_name_device_name_idx`. This is
deprecated and will be disallowed in a future release.')
result = self._query(query)
/usr/lib/python2./site-packages/pymysql/cursors.py:: Warning: (,
u'Duplicate index `uniq_instances0uuid`. This is deprecated and will be
disallowed in a future release.') result = self._query(query)
  • 验证Nova cell0 和cell1是否登记正确
[root@linux-node1 ~]# nova-manage cell_v2 list_cells
+-------+--------------------------------------+---------------------------------------+----------------------------------------------------+
| Name | UUID | Transport URL | Database Connection |
+-------+--------------------------------------+---------------------------------------+----------------------------------------------------+
| cell0 | ---- | none:/ | mysql+pymysql://nova:****@192.168.56.11/nova_cell0 |
| cell1 | 9f317433-ab20---a9faa94d5825 | rabbit://openstack:****@192.168.56.11 | mysql+pymysql://nova:****@192.168.56.11/nova |
+-------+--------------------------------------+---------------------------------------+----------------------------------------------------+
  • 启动Nova服务并设置为开机启动
systemctl enable openstack-nova-api.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-
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-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service

在计算节点安装Nova

  • 编辑/etc/nova/nova.conf并作出如下修改

[DEFAULT]
use_neutron=true 
firewall_driver=nova.virt.firewall.NoopFirewallDriver
enabled_apis=osapi_compute,metadata
transport_url=rabbit://openstack:openstack@192.168.56.11
[api]
auth_strategy=keystone 
[glance]
api_servers=192.168.56.11: 

[keystone_authtoken]
auth_uri = http://192.168.56.11:5000 
auth_url = http://192.168.56.11:35357
memcached_servers = 192.168.56.11:
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
[oslo_concurrency]
lock_path=/var/lib/nova/tmp 
[placement]
os_region_name = RegionOne 
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://192.168.56.11:35357/v3
username = placement
password = placement
[vnc]
enabled=true 
vncserver_listen=192.168.56.12
vncserver_proxyclient_address=192.168.56.12
novncproxy_base_url=http://192.168.56.11:6080/vnc_auto.html [libvirt]
# 暂时设置为qemu,生产应为
kvm virt_type = qemu
  • 启动Nova服务并设置为开机启动
[root@linux-node2 nova]# systemctl enable libvirtd.service openstack-nova-compute.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-
compute.service to /usr/lib/systemd/system/openstack-nova-compute.service.
[root@linux-node2 nova]# systemctl start libvirtd.service openstack-nova-compute.service
  • 确认计算节点已经在数据库:
[root@linux-node1 ~]# source admin-openstack.sh
[root@linux-node1 ~]# openstack compute service list --service nova-compute
+----+--------------+-------------------------+------+---------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At |
+----+--------------+-------------------------+------+---------+-------+----------------------------+
| | nova-compute | linux-node2.example.com | nova | enabled | up | --12T04::19.000000 |
+----+--------------+-------------------------+------+---------+-------+----------------------------+
  • 发现计算节点
[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
Found cell mappings.
Skipping cell0 since it does not contain hosts.
Getting compute nodes from cell 'cell1': 9f317433-ab20---a9faa94d5825
Found unmapped computes in cell: 9f317433-ab20---a9faa94d5825
Checking host mapping for compute host 'linux-node2.example.com': a9a6dc8c-41f3-4b44-ac5c-2d8b081bc77e
Creating host mapping for compute host 'linux-node2.example.com': a9a6dc8c-41f3-4b44-ac5c-2d8b081bc77e

至此,Nova服务配置完毕

OpenStack 安装:nova服务的更多相关文章

  1. OpenStack:安装Nova

    >安装Nova1. 安装# apt-get install nova-novncproxy novnc nova-api \  nova-ajax-console-proxy nova-cert ...

  2. OpenStack核心组件-nova计算服务

    1. nova介绍 Nova 是 OpenStack 最核心的服务,负责维护和管理云环境的计算资源.OpenStack 作为 IaaS 的云操作系统,虚拟机生命周期管理也就是通过 Nova 来实现的. ...

  3. openstack部署nova

    controller 一.创建nova数据库,并设置权限及远程登录 mysql -u root -p CREATE DATABASE nova_api; CREATE DATABASE nova; C ...

  4. openstack安装-计算节点-nova计算服务安装

    一.基础服务安装 先安装基础工具 yum install net-tools vim telnet wget lrzsz 1.添加hosts解析 cat << EOF >/etc/h ...

  5. CentOS7安装OpenStack(Rocky版)-04.安装Nova计算服务(控制节点)

    上一篇文章分享了glance镜像服务的安装配置,本文主要分享openstack的计算服务Nova的安装和配制方法 ------------------ 完美的分割线 ----------------- ...

  6. OpenStack Train版-6.安装nova计算服务(计算节点)

    安装nova计算服务(computel01计算节点 192.168.0.20)安装软件包 yum install centos-release-openstack-train -y yum insta ...

  7. OpenStack Train版-5.安装nova计算服务(控制节点)

    nova计算服务需要在 控制节点 和 计算节点 都安装 控制节点主要安装 ​ nova-api(nova主服务)​ nova-scheduler(nova调度服务)​ nova-conductor(n ...

  8. OpenStack控制节点上搭建Q版nova服务(step5)

    placement组件监听的端口号是:8778 nova组件监听的端口号是:6080.8774.8775 其中6080端口号是novncproxy监听的端口号. 1.安装服务组件 yum instal ...

  9. OpenStack 安装:neutron服务

    在上一篇中介绍了Nova的安装配置,这一篇介绍neutron 首先,创建neutron用户并设置密码为neutron [root@linux-node1 ~]# openstack user crea ...

随机推荐

  1. day08 学习小测试 九九乘法表 车牌划分计算 大文件读取操作

    1.1需求:读取一个100G的文件,检测文件中是否有关键字keys=['苍老师','小泽老师',"alex"], 如果有则替换成"***",并写入到另一个文件中 ...

  2. PythonStudy——变量 Variable

    变量 变量来源于数学,是计算机语言中能储存计算结果或能表示值抽象概念.变量可以通过变量名访问.在指令式语言中,变量通常是可变的:但在纯函数式语言(如Haskell)中,变量可能是不可变(immutab ...

  3. Written a lua threadpool

    工作原理 由于lua只能单线程运行,该lib要求所有lua代码在单线程,而多线程部分只能为c代码 具体用法上要求多线程部分必须用c实现 相关模块 线程池 异步函数实现框架 Now only a sle ...

  4. Docker之 数据持久化

    容器中数据持久化主要有两种方式: 数据卷(Data Volumes) 数据卷容器(Data Volumes Dontainers) 数据卷 数据卷是一个可供一个或多个容器使用的特殊目录,可以绕过UFS ...

  5. 2.2 如何在Visio中写上、下角标

    快捷键:下标[“Ctrl”+ “=”] 上标[“Ctrl”+“shift”+“=”]

  6. spring @Autowired注入对象,在构造方法中为null问题

    出现问题的代码如下: @Service public class BaseHttpServiceImpl implements BaseHttpClient { private final stati ...

  7. 读写txt

    FileStream fileStr = new FileStream("shaftCofig.txt", FileMode.OpenOrCreate); StreamReader ...

  8. 通过WebClient模拟post上传文件到服务器

    写在前面 最近一直在研究sharepoint的文档库,在上传文件到文档库的过程中,需要模拟post请求,也查找了几种模拟方式,webclient算是比较简单的方式. 一个例子 这里写一个简单接受pos ...

  9. 在HTML中限制input 输入框只能输入纯数字

    限制 input 输入框只能输入纯数字 onkeyup = "value=value.replace(/[^\d]/g,'')" 使用 onkeyup 事件,有 bug ,那就是在 ...

  10. Java产生死锁的一个简单例子

    思路是创建两个字符串a和b,再创建两个线程A和B,让每个线程都用synchronized锁住字符串(A先锁a,再去锁b:B先锁b,再锁a),如果A锁住a,B锁住b,A就没办法锁住b,B也没办法锁住a, ...