qiyutech.proxmox.hl_qemu_vm module – QEMU 虚拟机 创建/删除 接口¶
备注
This module is part of the qiyutech.proxmox collection (version 1.0.0).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install qiyutech.proxmox.
To use it in a playbook, specify: qiyutech.proxmox.hl_qemu_vm.
1.0.0 新版功能: of qiyutech.proxmox
Synopsis¶
创建、获取 QEMU 虚拟机的状态
备注
This module has a corresponding action plugin.
Parameters¶
Parameter |
Comments |
|---|---|
启用 QEMU 代理 |
|
网络桥接名称 例如: vmbr0 |
|
CPU核心数量 |
|
磁盘大小 单位: GB |
|
Proxmox API server 这个参数是必须的 参数获取顺序: 1 host 任务参数 2 proxmox_host 变量 (aka: task_vars 中的 proxmox_host 变量) 3 PROXMOX_HOST 任务环境变量 4 PROXMOX_HOST 全局环境变量 |
|
内存大小 单位: MB |
|
虚拟机的名称 |
|
PVE集群节点名称 |
|
启用 numa |
|
操作系统类型 Specify guest operating system. This is used to enable special optimization/features for specific operating systems: other: unspecified OS win7: Microsoft Windows 7 win8: Microsoft Windows 8/2012/2012r2 win10: Microsoft Windows 10/2016/2019 l24: Linux 2.4 Kernel l26: Linux 2.6 - 5.X Kernel solaris: Solaris/OpenSolaris/OpenIndiania kernel Choices:
|
|
CPU数量 Default: 1 |
|
虚拟机的状态 present 如果不存在则创建此虚拟机 absent 如果存在则删除此虚拟机 Choices:
|
|
Proxmox API Token ID 这个参数是必须的 参数获取顺序: 1 token_id 任务参数 2 proxmox_token_id 变量 (aka: task_vars 中的 proxmox_token_id 变量) 3 PROXMOX_TOKEN_ID 任务环境变量 4 PROXMOX_TOKEN_ID 全局环境变量 |
|
Proxmox API Token Secret 这个参数是必须的 参数获取顺序: 1 token_secret 任务参数 2 proxmox_token_secret 变量 (aka: task_vars 中的 proxmox_token_secret 变量) 3 PROXMOX_TOKEN_SECRET 任务环境变量 4 PROXMOX_TOKEN_SECRET 全局环境变量 |
|
VGA设置 格式为: type=xxx,memory=xxx 内存大小单位为: MB Ubuntu 无法自动启动的问题 [需要设置: vga: type=vmware]: https://forum.proxmox.com/threads/ubuntu-desktop-vm-stuck.67269/ vga type source code: https://github.com/proxmox/qemu-server/blob/master/PVE/QemuServer.pm#L192 当前支持的类型: cirrus qxl qxl2 qxl3 qxl4 none serial0 serial1 serial2 serial3 std virtio vmware |
|
虚拟机ID |
Examples¶
- name: Test with a message
qiyutech.proxmox.hl_qemu_vm:
host: https://proxmox.ksle.2cc.net
token_id: 'root@pam!demo'
token_secret: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'