MAAS 2.0。 导入自定义图像不起作用?

如何在Ubuntu 16.04 LTS Beta2中将自定义图像导入MAAS 2.0.0~beta2 + bzr4920?

我在1.9中成功使用的命令是上传图像而没有错误:

$ maas local boot-resources create -d name = custom / foo architecture = amd64 / generic filetype = tgz content @ = / tmp / ubuntu1604-tgz

此图像出现在MAAS>图像>生成的图像部分,但我似乎无法找到部署此图像的方法,因为只有官方http://images.maas.io/中的启动图像出现在操作系统中以进行部署名单。

BTW / tmp / ubuntu1604-tgz是来自/ var / lib / maas / boot-resources / cache /的官方Ubuntu 16.04的重命名副本,所以我相信图像本身应该没有任何问题,我只是遗漏了出来的东西。

$ dpkg -l | grep maas ii maas 2.0.0~beta2+bzr4920-0ubuntu2 all "Metal as a Service" is a physical cloud and IPAM ii maas-cli 2.0.0~beta2+bzr4920-0ubuntu2 all MAAS client and command-line interface ii maas-common 2.0.0~beta2+bzr4920-0ubuntu2 all MAAS server common files ii maas-dhcp 2.0.0~beta2+bzr4920-0ubuntu2 all MAAS DHCP server ii maas-dns 2.0.0~beta2+bzr4920-0ubuntu2 all MAAS DNS server ii maas-proxy 2.0.0~beta2+bzr4920-0ubuntu2 all MAAS Caching Proxy ii maas-rack-controller 2.0.0~beta2+bzr4920-0ubuntu2 all Rack Controller for MAAS ii maas-region-api 2.0.0~beta2+bzr4920-0ubuntu2 all Region controller API service for MAAS ii maas-region-controller 2.0.0~beta2+bzr4920-0ubuntu2 all Region Controller for MAAS ii python3-django-maas 2.0.0~beta2+bzr4920-0ubuntu2 all MAAS server Django web framework (Python 3) ii python3-maas-client 2.0.0~beta2+bzr4920-0ubuntu2 all MAAS python API client (Python 3) ii python3-maas-provisioningserver 2.0.0~beta2+bzr4920-0ubuntu2 all MAAS server provisioning libraries (Python 3) $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04 LTS Release: 16.04 Codename: xenial 

好的,对我感到羞耻。 我忘了跑

 maas local boot-resources import 

执行后

 maas local boot-resources create -d name=custom/foo architecture=amd64/generic filetype=tgz content@=/tmp/ubuntu1604-tgz 

我花了一段时间来弄清楚这一点。

由于MAAS文档在导入自定义图像方面相当差,我想我会写简短的指南如何做到这一点。

首先,您应该知道命名很重要 。 因此,如果要导入自定义图像,则应提供适当的名称参数:

 maas local boot-resources create name=custom/foo title="Title is not important" architecture=amd64/generic content@=/path/to/your/image maas local boot-resources import 

仔细看看name = custom / foo 。 MAAS期望自定义图像名称以自定义开头。 你在斜杠后写的没什么区别,所以name = custom / fooname = custom / bar123一样好。

如果要导入CentOS映像,根据src / provisioningserver / drivers / osystem / centos.py命名也很重要。 要导入CentOS 7.2的自定义映像,您应该执行:

 maas local boot-resources create -d name=centos/centos72 architecture=amd64/generic content@=/path/to/your/image maas local boot-resources import 

对,就是这样。 对于CentOS 7.2,名称参数应为name = centos / centos72 ,对于CentOS 6.7, 名称= centos / centos67 ,依此类推。 这就是发行版匹配regexp的方式。

尚未尝试导入自定义SuSE和Windows映像,但也应该有命名限制。 只需查看src / provisioningserver / drivers / osystem /中的 MAAS源代码。