我想使用 MAAS CLI 将新机器添加到 MAAS 进行调试和部署。添加支持 IPMI 电源参数的新机器的 MAAS CLI 命令是什么?
答案1
以下是如何添加机器的示例:
maas maasadmin machines create \
hostname=<hostname> \
fqdn=<hostname>.maas \
mac_addresses=<mac_used_for_dhcp> \
architecture=amd64 \
power_type=ipmi \
power_parameters_power_driver=LAN_2_0 \
power_parameters_power_user=<ipmi_user> \
power_parameters_power_pass=<ipmi_password> \
power_parameters_power_address=<mgmt_ip_address>
输入:
主机名:无论您想给新机器贴什么标签。
MAC地址:新机器上适配器的 MAC 地址将接收 DHCP 地址,然后返回 MAAS 获取 PXE 映像。
ipmi_用户/密码:您机器的控制卡上的用户帐户(例如 Dell iDRAC)
管理 IP 地址:你的机器控制卡的 IP 地址(例如 Dell iDRAC)
以下内容是从 MAAS api 源代码中提取的,用于创建新机器。
"""Create a new Machine.
Adding a server to a MAAS puts it on a path that will wipe its disks
and re-install its operating system, in the event that it PXE boots.
In anonymous enlistment (and when the enlistment is done by a
non-admin), the machine is held in the "New" state for approval by a
MAAS admin.
The minimum data required is:
architecture=<arch string> (e.g. "i386/generic")
mac_addresses=<value> (e.g. "aa:bb:cc:dd:ee:ff")
:param architecture: A string containing the architecture type of
the machine. (For example, "i386", or "amd64".) To determine the
supported architectures, use the boot-resources endpoint.
:type architecture: unicode
:param min_hwe_kernel: A string containing the minimum kernel version
allowed to be ran on this machine.
:type min_hwe_kernel: unicode
:param subarchitecture: A string containing the subarchitecture type
of the machine. (For example, "generic" or "hwe-t".) To determine
the supported subarchitectures, use the boot-resources endpoint.
:type subarchitecture: unicode
:param mac_addresses: One or more MAC addresses for the machine. To
specify more than one MAC address, the parameter must be specified
twice. (such as "machines new mac_addresses=01:02:03:04:05:06
mac_addresses=02:03:04:05:06:07")
:type mac_addresses: unicode
:param hostname: A hostname. If not given, one will be generated.
:type hostname: unicode
:param domain: The domain of the machine. If not given the default
domain is used.
:type domain: unicode
:param power_type: A power management type, if applicable (e.g.
"virsh", "ipmi").
:type power_type:unicode
:param power_parameters_{param}: The parameter(s) for the power_type.
Note that this is dynamic as the available parameters depend on
the selected value of the Machine's power_type. `Power types`_
section for a list of the available power parameters for each
power type.
:type power_parameters_{param1}: unicode
"""