maas中node的几种状态和动作

来源:互联网 发布:mac ae2017百度云盘 编辑:程序博客网 时间:2024/06/05 04:43

MAAS+JUJU+OPENSTACK很多人布置过,都是手工布置,很少使用ansible这种现代化工具。当然工具也只是程序化一些步骤。

现在将MAAS添加节点时的一些节点状态说明一下

前提条件

1 MAAS版本1.95(最新为2.2)

2 要创建的节点是通过vagrant创建的虚拟机,provider是libvirt(或者说虚拟机基于qemu/kvm)

以下所称的节点,虚拟机即指此处的vagrant的虚机

3 将要创建的节点的网络指定为通过MAAS的DHCP申请,并设置为网络启动(即PXE)


现在将状态例举如下,


4 NEW状态(后面是中文) 新添加节点

MAAS向节点里下发的软件和动作如下,

  1. DHCP server is contacted
  2. kernel and initrd are received over TFTP
  3. machine boots
  4. initrd mounts a Squashfs image ephemerally over iSCSI
  5. cloud-init runs enlistment scripts
  6. machine shuts down
此时在MAAS GUI上可以设置节点的电源参数(可参考张华的博客)


在设置电源参数后,可以通过如下命令访问节点

virsh -c qemu+ssh://<USER>@<KVM_HOST>/system list --all
也可以通过vncviewer访问,其命令类似

vagrant status 查看虚拟机状态

virsh vncdisplay xxxx 显示虚机vnc监听端口

vncviewer xx:5908 查看vnc


5 提交

  1. DHCP server is contacted
  2. kernel and initrd are received over TFTP
  3. machine boots
  4. initrd mounts a Squashfs image ephemerally over iSCSI
  5. cloud-init runs commissioning scripts
  6. machine shuts down
注意就cloud-init的表现不同

这一步前提条件是MAAS GUI上已经有下载映像。默认是UBUNTU LTS最新版本。

由于下载会比较慢,我采用的是本地映像(通过sstream-mirror镜像了官方映像)。

目前看,由于UBUNTU 14.04LTS会引起qemu内部错误,所以建议使用16.04LTS作为映像。

提交前状态:NEW

提交中状态:Commisioning

提交后状态:READY

失败后状态:Failed Commissioning


6 部署 就是向节点安装操作系统到硬盘上


这个阶段MAAS对节点干了这些事情

  1. DHCP server is contacted
  2. kernel and initrd are received over TFTP
  3. machine boots
  4. initrd mounts a Squashfs image ephemerally over iSCSI
  5. cloud-init triggers deployment process
    1. curtin installation script is run
    2. Squashfs image (same as above) is placed on disk
使用的安装方法叫curtin,使用的安装范本叫preseed文件,安装类似dpkg

安装的前提是 SSH key要就绪(MAAS GUI上可以看到SSH KEY)

部署前状态:READY 或者Allocated

部署中状态:deploying

部署后状态:deployed(此时会显示部署的操作系统名称)

失败后状态:failed to deploy

这个部署对于使用juju的场景需要额外说明,FIXME



参考

https://docs.ubuntu.com/maas/2.0/en/installconfig-commission-nodes

注意参考版本是2.0的

部署状态的链接如下

https://docs.ubuntu.com/maas/2.0/en/installconfig-nodes-deploy

原创粉丝点击