community.general.vmadm module – Manage SmartOS virtual machines and zones
Note
This module is part of the community.general collection (version 10.0.1).
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 community.general
.
To use it in a playbook, specify: community.general.vmadm
.
Synopsis
Manage SmartOS virtual machines through vmadm(1M).
Parameters
Parameter |
Comments |
---|---|
When enabled, the zone dataset will be mounted on Choices:
|
|
Whether or not a VM is booted when the system is rebooted. Choices:
|
|
Set the boot order for KVM VMs. |
|
Type of virtual machine. The Choices:
|
|
Sets a limit on the amount of CPU time that can be used by a VM. Use |
|
Sets a limit on the number of fair share scheduler (FSS) CPU shares for a VM. This limit is relative to all other VMs on the system. |
|
Control the type of virtual CPU exposed to KVM VMs. Choices:
|
|
Metadata to be set and associated with this VM, this contain customer modifiable keys. |
|
Whether to delegate a ZFS dataset to an OS VM. Choices:
|
|
Default value for a virtual disk model for KVM guests. |
|
A list of disks to add, valid properties are documented in vmadm(1M). |
|
Domain value for |
|
Mount additional filesystems into an OS VM. |
|
Enables the firewall, allowing fwadm(1M) rules to be applied. Choices:
|
|
Force a particular action (i.e. stop or delete a VM). Choices:
|
|
Comma separated list of filesystem types this zone is allowed to mount. |
|
Zone/VM hostname. |
|
Image UUID. |
|
Adds an Choices:
|
|
Adds an Choices:
|
|
Metadata to be set and associated with this VM, this contains operator generated keys. |
|
List of namespaces to be set as |
|
Kernel version to emulate for LX VMs. |
|
Set (comma separated) list of privileges the zone is allowed to use. |
|
Resolvers in Choices:
|
|
Total amount of memory (in MiBs) on the host that can be locked by this VM. |
|
Maximum number of lightweight processes this VM is allowed to have running. |
|
Maximum amount of memory (in MiBs) on the host that the VM is allowed to use. |
|
Maximum amount of virtual memory (in MiBs) the VM is allowed to use. |
|
Timeout in seconds (or 0 to disable) for the |
|
Name of the VM. vmadm(1M) uses this as an optional name. |
|
Default value for a virtual NIC model for KVM guests. |
|
A list of nics to add, valid properties are documented in vmadm(1M). |
|
Consider the provisioning complete when the VM first starts, rather than when the VM has rebooted. Choices:
|
|
Additional qemu cmdline arguments for KVM guests. |
|
Additional qemu arguments for KVM guests. This overwrites the default arguments provided by vmadm(1M) and should only be used for debugging. |
|
Quota on zone filesystems (in MiBs). |
|
Amount of virtual RAM for a KVM guest (in MiBs). |
|
List of resolvers to be put into |
|
Dictionary that maps destinations to gateways, these will be set as static routes in the VM. |
|
Addition options for SPICE-enabled KVM VMs. |
|
Password required to connect to SPICE. By default no password is set. Please note this can be read from the Global Zone. |
|
States for the VM to be in. Please note that Choices:
|
|
Amount of memory (in MiBs) that will be available in the VM for the |
|
UUID of the VM. Can either be a full UUID or |
|
Number of virtual CPUs for a KVM guest. |
|
Specify VGA emulation used by KVM VMs. |
|
Number of packets that can be sent in a single flush of the tx queue of virtio NICs. |
|
Timeout (in nanoseconds) for the TX timer of virtio NICs. |
|
Password required to connect to VNC. By default no password is set. Please note this can be read from the Global Zone. |
|
TCP port to listen of the VNC server. Or set |
|
Specifies compression algorithm used for this VMs data dataset. This option only has effect on delegated datasets. |
|
Suggested block size (power of 2) for files in the delegated dataset’s filesystem. |
|
Maximum number of filesystems the VM can have. |
|
IO throttle priority value relative to other VMs. |
|
Specifies compression algorithm used for this VMs root dataset. This option only has effect on the zoneroot dataset. |
|
Suggested block size (power of 2) for files in the zoneroot dataset’s filesystem. |
|
Number of snapshots the VM can have. |
|
ZFS pool the VM’s zone dataset will be created in. |
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Examples
- name: Create SmartOS zone
community.general.vmadm:
brand: joyent
state: present
alias: fw_zone
image_uuid: 95f265b8-96b2-11e6-9597-972f3af4b6d5
firewall_enabled: true
indestructible_zoneroot: true
nics:
- nic_tag: admin
ip: dhcp
primary: true
internal_metadata:
root_pw: 'secret'
quota: 1
- name: Delete a zone
community.general.vmadm:
alias: test_zone
state: deleted
- name: Stop all zones
community.general.vmadm:
uuid: '*'
state: stopped
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Alias of the managed VM. Returned: When addressing a VM by alias. Sample: |
|
State of the target, after execution. Returned: success Sample: |
|
UUID of the managed VM. Returned: always Sample: |