ngine_io.cloudstack.cs_host 模块 – 管理基于 Apache CloudStack 云的宿主机。
注意
此模块是 ngine_io.cloudstack 集合 (版本 2.5.0) 的一部分。
如果您使用的是 ansible
软件包,则可能已安装此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install ngine_io.cloudstack
。您需要其他要求才能使用此模块,有关详细信息,请参阅 要求。
要在剧本中使用它,请指定: ngine_io.cloudstack.cs_host
。
ngine_io.cloudstack 0.1.0 中的新增功能
摘要
创建、更新和删除宿主机。
要求
在执行此模块的主机上需要以下要求。
python >= 2.6
cs >= 0.9.0
参数
参数 |
注释 |
---|---|
宿主机分配状态。 选项
|
|
用于查询 API 端点的 HTTP 方法。 如果没有给出,则考虑 选项
|
|
CloudStack API 的 API 密钥。 如果没有给出,则考虑 |
|
CloudStack API 的密钥。 如果未设置,则考虑 |
|
HTTP 超时时间(秒)。 如果没有给出,则考虑 默认: |
|
CloudStack API 的 URL,例如 https://cloud.example.com/client/api。 如果没有给出,则考虑 |
|
验证 CA 授权证书文件。 如果没有给出,则考虑 |
|
集群名称。 |
|
宿主机标签。 |
|
集群名称。 如果 *state=present* 且宿主机尚不存在,则为必需。 可能的值为 |
|
宿主机名称。 |
|
宿主机密码。 如果 *state=present* 且宿主机尚不存在,则为必需。 |
|
Pod 名称。 如果 *state=present* 且宿主机尚不存在,则为必需。 |
|
宿主机状态。 选项
|
|
用于创建宿主机的宿主机 URL。 如果未提供,则使用 仅在 *state=present* 且宿主机尚不存在时才考虑。 |
|
宿主机用户名。 如果 *state=present* 且宿主机尚不存在,则为必需。 |
|
如果为 如果没有给出,则考虑 这只能在使用自签名证书的个人控制站点上使用。 选项
|
|
应在其中部署宿主机的区域名称。 |
注释
注意
有关 cloudstack 模块的详细指南,请参见 CloudStack 云指南。
此模块支持检查模式。
示例
- name: Ensure a host is present but disabled
ngine_io.cloudstack.cs_host:
name: pod01.zone01.example.com
cluster: vcenter.example.com/zone01/cluster01
pod: pod01
zone: zone01
hypervisor: VMware
allocation_state: disabled
host_tags:
- perf
- gpu
- name: Ensure an existing host is disabled
ngine_io.cloudstack.cs_host:
name: pod01.zone01.example.com
zone: zone01
allocation_state: disabled
- name: Ensure an existing host is enabled
ngine_io.cloudstack.cs_host:
name: pod01.zone01.example.com
zone: zone01
allocation_state: enabled
- name: Ensure a host is absent
ngine_io.cloudstack.cs_host:
name: pod01.zone01.example.com
zone: zone01
state: absent
返回值
常见返回值已在此处记录 此处,以下是此模块特有的字段
键 |
描述 |
---|---|
宿主机分配状态。 返回: success 示例: |
|
宿主机功能。 返回: success 示例: |
|
宿主机的集群。 返回: success 示例: |
|
宿主机集群的类型。 返回: success 示例: |
|
当前分配的宿主机 CPU 百分比。 返回: success 示例: |
|
宿主机 CPU 数量。 返回: success 示例: |
|
宿主机CPU插槽数量。 返回: success 示例: |
|
CPU速度(MHz)。 返回: success 示例: |
|
宿主机当前CPU使用量。 返回: success 示例: |
|
应用cpu.overprovisioning.factor后的宿主机CPU数量。 返回: success 示例: |
|
宿主机创建日期。 返回: success 示例: |
|
宿主机断开连接日期。 返回: success 示例: |
|
宿主机当前已分配的磁盘大小。 返回: success 示例: |
|
宿主机总磁盘大小。 返回: success 示例: |
|
宿主机可用的事件。 返回: success 示例: |
|
宿主机上存在的GPU卡。 返回: success 示例: |
|
宿主机是否为高可用性(HA)主机。 返回: success 示例: |
|
宿主机是否拥有足够的CPU和RAM容量来迁移虚拟机。 返回: success 示例: |
|
宿主机标签的逗号分隔列表。 返回: success 示例: |
|
宿主机类型。 返回: success 示例: |
|
宿主机版本。 返回: success 示例: |
|
宿主的虚拟化平台。 返回: success 示例: |
|
虚拟化平台版本。 返回: success 示例: |
|
宿主机IP地址。 返回: success 示例: |
|
本地存储是否可用。 返回: success 示例: |
|
最后一次ping宿主机的时间。 返回: success 示例: |
|
宿主机的管理服务器ID。 返回: success 示例: |
|
宿主机当前已分配的内存量。 返回: success 示例: |
|
宿主机总内存量。 返回: success 示例: |
|
宿主机当前使用的内存量。 返回: success 示例: |
|
宿主机名称。 返回: success 示例: |
|
宿主机入站网络流量。 返回: success 示例: |
|
宿主机出站网络流量。 返回: success 示例: |
|
宿主机操作系统类别名称。 返回: success 示例: |
|
宿主机带外管理信息。 返回: success 示例: |
|
宿主机的Pod名称。 返回: success 示例: |
|
宿主机移除的日期和时间。 返回: success 示例: |
|
宿主机的资源状态。 返回: success 示例: |
|
宿主机状态。 返回: success 示例: |
|
该宿主机是否适合(拥有足够的容量并满足所有条件,例如主机标签、最大虚拟机数量限制等)迁移虚拟机。 返回: success 示例: |
|
宿主机的区域。 返回: success 示例: |