Ironic 裸金属实例的部署流程
目录
逻辑架构
部署架构
前提条件
官方文档:https://docs.openstack.org/ironic/latest/user/index.html
- Dependent packages to be configured on the Bare Metal service node(s) where ironic-conductor is running like tftp-server, ipmi, syslinux etc for bare metal provisioning.
- Nova must be configured to make use of the bare metal service endpoint and compute driver should be configured to use ironic driver on the Nova compute node(s).
- Flavors to be created for the available hardware. Nova must know the flavor to boot from.
- Images to be made available in Glance. Listed below are some image types required for successful bare metal deployment:
- bm-deploy-kernel
- bm-deploy-ramdisk
- user-image
- user-image-vmlinuz
- user-image-initrd
- Hardware to be enrolled(注册) via Ironic RESTful API service.
部署流程
- A boot instance request comes in via the Nova API, through the message queue to the Nova scheduler.
- Nova scheduler applies filters and finds the eligible hypervisor. The nova scheduler also uses the flavor’s extra_specs, such as cpu_arch, to match the target physical node.
- Nova compute manager claims the resources of the selected hypervisor.
- Nova compute manager creates (unbound) tenant virtual interfaces (VIFs) in the Networking service according to the network interfaces requested in the nova boot request. A caveat here is, the MACs of the ports are going to be randomly generated, and will be updated when the VIF is attached to some node to correspond to the node network interface card’s (or bond’s) MAC.
- A spawn task is created by the nova compute which contains all the information such as which image to boot from etc. It invokes the driver.spawn from the virt layer of Nova compute. During the spawn process, the virt driver does the following:
- Updates the target ironic node with the information about deploy image, instance UUID, requested capabilities and various flavor properties.
- Validates node’s power and deploy interfaces, by calling the ironic API.
- Attaches the previously created VIFs to the node. Each neutron port can be attached to any ironic port or port group, with port groups having higher priority than ports. On ironic side, this work is done by the network interface. Attachment here means saving the VIF identifier into ironic port or port group and updating VIF MAC to match the port’s or port group’s MAC, as described in bullet point 4.
- Generates config drive, if requested.
- Nova’s ironic virt driver issues a deploy request via the Ironic API to the Ironic conductor servicing the bare metal node.
- Virtual interfaces are plugged in and Neutron API updates DHCP port to set PXE/TFTP options. In case of using neutron network interface, ironic creates separate provisioning ports in the Networking service, while in case of flat network interface, the ports created by nova are used both for provisioning and for deployed instance networking.
- The ironic node’s boot interface prepares (i)PXE configuration and caches deploy kernel and ramdisk.
- The ironic node’s management interface issues commands to enable network boot of a node.
- The ironic node’s deploy interface caches the instance image (in case of iscsi deploy interface), and kernel and ramdisk if needed (it is needed in case of netboot for example).
- The ironic node’s power interface instructs the node to power on.
- The node boots the deploy ramdisk.
- Depending on the exact driver used, either the conductor copies the image over iSCSI to the physical node (iSCSI deploy) or the deploy ramdisk downloads the image from a temporary URL (Direct deploy). The temporary URL can be generated by Swift API-compatible object stores, for example Swift itself or RadosGW. The image deployment is done.
- The node’s boot interface switches pxe config to refer to instance images (or, in case of local boot, sets boot device to disk), and asks the ramdisk agent to soft power off the node. If the soft power off by the ramdisk agent fails, the bare metal node is powered off via IPMI/BMC call.
- The deploy interface triggers the network interface to remove provisioning ports if they were created, and binds the tenant ports to the node if not already bound. Then the node is powered on.
- The bare metal node’s provisioning state is updated to active.
iSCSI Deploy UML
With iscsi deploy interface, the deploy ramdisk publishes the node’s hard drive as an iSCSI share. The ironic-conductor then copies the image to this share. This interface is used by default.
openstack baremetal node create --driver ipmi --deploy-interface iscsi
openstack baremetal node set <NODE> --deploy-interface iscsi
- 通过 Nova API 发起裸金属实例部署请求。
- Nova Scheduler 根据请求中的参数信息(e.g. 硬件模板、镜像等)筛选合适的 ironic node。例如:调度因子通常包含在 Flavor 的 extra_spec 属性中(e.g. cpu_arch、baremetal:deploy_kerner_id、baremmetal:deploy_ramdisk_id)。
- Nova Compute 将部署裸机所需要的信息都整理好,然后 Spawn 一个 Build 任务,主要是调用并传递参数到 Ironic API 实际执行,Ironic 将此任务中所需要的硬件资源信息持久化到数据库中。
- Ironic 与 OpenStack 的其他服务交互,从 Glance 服务获取 Images(Deploy Images & User Images),调用 Neutron 服务为裸机创建端口,调用 Cinder 服务获取Volumes 等。
- Ironic 开始执行真正的裸机部署,PXE Driver 准备好 TFTP 和 Bootloader,IPMI Driver 设置裸机启动模式为 PXE 并起电。
- 裸机启电后,通过 DHCP 获得 Ironic Conductor 的地址并尝试通过 TFTP 从 Conductor 获取 Deploy Images,Conductor 部署好 RAMDisk 之后,IPA 就可以通过 iSCSI 协议将裸机的硬盘暴露出来,Conductor 随后注入 User Images 到裸机磁盘作为根磁盘。
- 根磁盘部署完成后,IPMI Driver 调整裸机引导顺序,完成部署。
PXE Deploy Driver
Direct Deploy UML
*With direct deploy interface, the deploy ramdisk fetches the image from an HTTP location. It can be an object storage (swift or RadosGW) temporary URL or a user-provided HTTP URL. The deploy ramdisk then copies the image to the target disk. *
openstack baremetal node create --driver ipmi --deploy-interface direct
openstack baremetal node set <NODE> --deploy-interface direct
- 加入 Provision Network。
- 重启裸机。
- IPA 通过 lookup 从 Ironic Conductor 取得它对应的 ironic_node_uuid。
- IPA 通过 Heartbeat 与 Ironic 通信,驱动部署流程触发 ironic-conductor 发送 prepare_image 命令到 IPA,让 IPA 直接**(Direct)**下载并注入用户镜像到本地磁盘。写镜像是一个耗时较长的动作,通常 300GB 大小的镜像需要十分钟左右。
- ironic-conductor 收到 Heartbeat 消息后(从 ironic-api 过来的 RPC 消息),根据当前状态的不同有相应的处理。第一个 Heartbeat 消息会触发 ironic-conductor 下发 prepare_image 到 IPA,以后的 Heartbeat 消息会触发 ironic-conductor 查询 IPA 上的 command status,它的目的是要监控 prepare_image 等 command 是否还在运行中。一旦 command status 显示命令结束。就会继续下一步部署操作,包括设置物理服务器从磁盘启动、关机、切换网络、开机。知道部署流程结束。
IPA Deploy Driver
Ironic 裸金属实例的部署流程的更多相关文章
- 注册 Ironic 裸金属节点并部署裸金属实例
目录 文章目录 目录 前文列表 注册(Enrollment)裸机 创建裸金属实例的 Flavor 部署裸金属实例 日志分析 问题:Failed to create neutron ports for ...
- Ironic 裸金属管理服务的网络模型
目录 文章目录 目录 Bare-Metal networking in Neutron 核心网络类型 网络拓扑 抽象网络拓扑图 Neutron Implementation Neutron 了解裸金属 ...
- Ironic 裸金属管理服务
目录 文章目录 目录 Ironic 软件架构设计 资源模型设计 全生命周期的状态机设计 Inspection 裸金属上架自检阶段 Provision 裸金属部署阶段 Clean 裸金属回收阶段 快速体 ...
- OpenStack Newton:集虚拟化,裸金属和容器部署的统一云平台(转载)
2016-10-08木屐大数据在线 国庆长假第六天,OpenStack第十四版本Newton(牛顿?)发布,官方介绍中强调这是一个集虚拟化.裸金属和容器技术的一体化平台,可通过一套API来管理裸金属. ...
- 手动集成 Ironic 裸金属管理服务(Rocky)
目录 文章目录 目录 前文列表 横向扩展裸金属管理服务节点 配置基础设施 安装 Ironic(BareMetal) 安装 Nova Compute(BareMetal) 配置 Neutron 提供 P ...
- Ironic 裸金属管理服务的底层技术支撑
目录 文章目录 目录 底层技术支撑 DHCP NBP TFTP IPMI PXE & iPXE Cloud Init Linux 操作系统启动引导过程 底层技术支撑 PXE:预启动执行环境,支 ...
- 使用disk-image-builder(DIB)制作Ironic 裸金属镜像
export DIB_DEV_USER_USERNAME=centos export DIB_DEV_USER_PASSWORD= export DIB_DEV_USER_PWDLESS_SUDO=Y ...
- OpenStack-Ironic裸金属简介
一,Ironic简述 简而言之,OpenStack Ironic就是一个进行裸机部署安装的项目. 所谓裸机,就是指没有配置操作系统的计算机.从裸机到应用还需要进行以下操作: (1)硬盘RAID ...
- 金融云原生漫谈(三)|银行云原生基础设施构建:裸金属VS虚拟机
在金融行业数字化转型的驱动下,国有银行.股份制银行和各级商业银行也纷纷步入容器化的进程. 如果以容器云上生产为目标,那么整个容器云平台的设计.建设和优化对于银行来说是一个巨大的挑战.如何更好地利用 ...
随机推荐
- 03:Java基础语法(二)
Java基础语法 Java运算符 算术运算符 运算符是一种特殊的符号,用以表示数据的运算.赋值和比较等.1.操作数:参与运算的数据 称为操作数.2.表达式:运算符和操作数的整体 称为表达式.单独的一个 ...
- FASTCGI/CGI
在了解这两个协议之前,我们先谈一下动态网页 动态网页 是指跟静态网页相对的一种网页编程技术.静态网页,随着html代码的生成,页面的内容和显示效果就基本上不会发生变化了--除非你修改页面代码.而动态网 ...
- python文件操作:文件处理案例
储存一个文件,文件上有多个用户名,密码,做一个认证的流程程序,首先创建一个文件,文件上输入多个用户名,及对应的密码,然后让客户输入用户名和密码,进行用户名和密码核对,如果输入正确,则的认证成功,bre ...
- 编译TensorFlow-serving GPU版本
编译TensorFlow-serving GPU版本 TensorFlow Serving 介绍 编译GPU版本 下载源码 git clone https://github.com/tensorflo ...
- 11.tensorboard网络结构
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # 载入数据集 mnist = i ...
- socket 测试工具java
SocketTest.jar http://sockettest.sourceforge.net/
- hive日期函数-原生函数(二)
1. from_unixtime 日期函数UNIX时间戳转日期函数: from_unixtime 语法:from_unixtime(bigint unixtime[, stringformat]) 返 ...
- Hadoop-No.7之行键
和哈希表类比,HBase中的行键类似于哈希表中的键.要构造一个良好的HBase模式,关键之一就是选择一个合适的行键. 1 记录检索 行键是HBase中检索记录所使用的键.HBase记录含有的列在数量上 ...
- [BJOI2015]树的同构 && 树哈希教程
题目链接 有根树的哈希 离散数学中对树哈希的描述在这里.大家可以看看. 判断有根树是否同构,可以考虑将有根树编码.而编码过程中,要求保留树形态的特征,同时忽略子树顺序的不同.先来看一看这个方法: 不妨 ...
- XOR Guessing
E. XOR Guessing 第一次做这种交互题,刚开始还看不懂,现在已经差不多可以理解了,清空缓存区用cout<<endl;即可,需要注意的是,如果用fflush(stdout)来 ...