虚拟化

OpenStack安装笔记四

2019-02-09  本文已影响0人  zhouf_cq

之前安装了nova 的controller node,今天试一下compute node
参照官网文档 Install and configure a compute node
进入CentOS版本

Install the packages

yum install -y openstack-nova-compute

下载安装的包有205个,有许多的依赖包

修改配置文件/etc/nova/nova.conf
修改完配置文件后,检查cpu虚拟化支持

egrep -c '(vmx|svm)' /proc/cpuinfo

根据查询结果进行配置修改
开启并启动服务

systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service

在controller端添加compute node的注册

[root@controller ~]# . admin-openrc
[root@controller ~]# openstack compute service list --service nova-compute
+----+--------------+----------+------+---------+-------+----------------------------+
| ID | Binary       | Host     | Zone | Status  | State | Updated At                 |
+----+--------------+----------+------+---------+-------+----------------------------+
|  6 | nova-compute | computer | nova | enabled | up    | 2019-02-09T05:27:04.000000 |
+----+--------------+----------+------+---------+-------+----------------------------+
[root@controller ~]# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
Found 2 cell mappings.
Skipping cell0 since it does not contain hosts.
Getting computes from cell 'cell1': c2b3d0d9-a848-4b70-9880-1131bf442adb
Checking host mapping for compute host 'computer': fd0cd889-6b4c-4cab-9072-d113b420b118
Creating host mapping for compute host 'computer': fd0cd889-6b4c-4cab-9072-d113b420b118
Found 1 unmapped computes in cell: c2b3d0d9-a848-4b70-9880-1131bf442adb

接下来验证

[root@controller ~]# . admin-openrc
[root@controller ~]# openstack compute service list
[root@controller ~]# openstack catalog list
[root@controller ~]# openstack image list
[root@controller ~]# nova-status upgrade check

其它验证都正常,只是image list显示结果为空,未知,待查

......

网上找到了处理image list为空的方法,参考 https://www.cnblogs.com/charles1ee/p/6404412.html

首先下载镜像

wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img

使用glance创建一个镜像

openstack image create "cirros" \
  --file cirros-0.3.4-x86_64-disk.img \
  --disk-format qcow2 --container-format bare \
  --public

单独一行命令为

openstack image create "cirros"  --file cirros-0.3.4-x86_64-disk.img  --disk-format qcow2 --container-format bare  --public

这个需要之前的环境admin-openrc
重新查看image list就有显示了

[root@controller ~]# openstack image list
+--------------------------------------+--------+--------+
| ID                                   | Name   | Status |
+--------------------------------------+--------+--------+
| 6bf059f4-b31c-4ff0-ab45-db28e8a154bc | cirros | active |
+--------------------------------------+--------+--------+
上一篇 下一篇

猜你喜欢

热点阅读