Bare Metal服务通过裸金属实例管理驱动实现裸金属管理的相关操作。裸金属实例管理驱动是由一系列硬件接口组成,以实现相关操作,分为ipmi、redfish等通用型驱动,与ibmc、ilo、irmc等特定厂商驱动。本小节以ipmi驱动为例子,介绍如何在Bare Metal服务中增加裸金属实例管理驱动。
以下操作在裸金属服务管理baremetal节点操作。
- 启用裸金属实例管理驱动。
在“/etc/ironic/ironic.conf”文件中,将对应配置设置为如下内容。
| [DEFAULT]
enabled_hardware_types = ipmi
|
- 启用硬件接口。
在“/etc/ironic/ironic.conf”文件中,将对应配置设置为如下内容。
| [DEFAULT]
enabled_boot_interfaces = pxe
enabled_console_interfaces = ipmitool-socat,no-console
enabled_deploy_interfaces = iscsi,direct
enabled_inspect_interfaces = no-inspect,inspector
enabled_management_interfaces = ipmitool
enabled_network_interfaces = flat,neutron
enabled_power_interfaces = ipmitool
enabled_raid_interfaces = agent,no-raid
enabled_storage_interfaces = cinder,noop
enabled_vendor_interfaces = ipmitool,no-vendor
|
- 设置硬件接口默认值。
在“/etc/ironic/ironic.conf”文件中,将对应配置设置为如下内容。
| [DEFAULT]
default_deploy_interface = iscsi
default_network_interface = flat
default_inspect_interface = inspector
default_raid_interface = no-raid
|
- 配置IPMI支持。
- 安装ipmitool。
| sudo yum install ipmitool
|
或者通过源码进行安装:https://github.com/ipmitool/ipmitool
- 安装完成后,可运行ipmitool命令进行验证。
| ipmitool -I lanplus -H ip-address -U username -P password chassis power status
|
将ip-address、username和password分别设置为待验证服务器BMC的IP地址、账号和密码。
- 配置ISCSI支持。
在ironic-conductor节点安装qemu-img与iscsiadm工具。
| yum install iscsi-initiator-utils qemu-img
|
- 配置direct部署支持。
direct部署可通过对象存储服务或者http服务实现。若使用对象存储服务则要求镜像服务glance后端需对接对象存储服务swift或ceph,同时完成对象存储服务中tempUrl配置。本小节使用http服务实现direct部署。
- 安装apache服务。
sudo yum install httpd
- 开启apache httpd服务。
systemctl enable httpd.service
systemctl restart httpd.service
- 创建http根目录。
| sudo mkdir -p /httpboot
sudo chown -R ironic /httpboot
|
- 在“/etc/httpd/conf.d”目录下创建ironic-http-wsgi.conf文件并添加如下内容:
1
2
3
4
5
6
7
8
9
10
11
12 | Listen 3928
<VirtualHost *:3928>
DocumentRoot "/httpboot"
<Directory "/httpboot">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
|
- 重新加载配置文件。
| sudo systemctl reload httpd
|
- 在“/etc/ironic/ironic.conf”文件中,设置如下内容:
| [deploy]
http_root=/httpboot
http_url=${my_ip}:3928
[agent]
image_download_source = http
|
同时应确保正确配置http_url与http_root。
- 重启服务。
| sudo systemctl restart openstack-ironic-conductor
|