Management of SmartOS Standalone Compute Nodes
Jorge Schrauwen <sjorge@blackdot.be>
new
vmadm, imgadm
smartos
New in version 2016.3.0.
vmtest.example.org:
smartos.vm_present:
- config:
reprovision: true
- vmconfig:
image_uuid: c02a2044-c1bd-11e4-bd8c-dfc1db8b0182
brand: joyent
alias: vmtest
quota: 5
max_physical_memory: 512
tags:
label: 'test vm'
owner: 'sjorge'
nics:
"82:1b:8e:49:e9:12":
nic_tag: trunk
mtu: 1500
ips:
- 172.16.1.123/16
- 192.168.2.123/24
vlan_id: 10
"82:1b:8e:49:e9:13":
nic_tag: trunk
mtu: 1500
ips:
- dhcp
vlan_id: 30
filesystems:
"/bigdata":
source: "/bulk/data"
type: lofs
options:
- ro
- nodevices
kvmtest.example.org:
smartos.vm_present:
- vmconfig:
brand: kvm
alias: kvmtest
cpu_type: host
ram: 512
vnc_port: 9
tags:
label: 'test kvm'
owner: 'sjorge'
disks:
disk0:
size: 2048
model: virtio
compression: lz4
boot: true
nics:
"82:1b:8e:49:e9:15":
nic_tag: trunk
mtu: 1500
ips:
- dhcp
vlan_id: 30
docker.example.org:
smartos.vm_present:
- config:
auto_import: true
reprovision: true
- vmconfig:
image_uuid: emby/embyserver:latest
brand: lx
alias: mydockervm
quota: 5
max_physical_memory: 1024
tags:
label: 'my emby docker'
owner: 'sjorge'
resolvers:
- 172.16.1.1
nics:
"82:1b:8e:49:e9:18":
nic_tag: trunk
mtu: 1500
ips:
- 172.16.1.118/24
vlan_id: 10
filesystems:
"/config:
source: "/vmdata/emby_config"
type: lofs
options:
- nodevices
cleanup_images:
smartos.image_vacuum
Note
Keep in mind that when removing properties from vmconfig they will not get removed from the vm's current configuration, except for nics, disk, tags, ... they get removed via add_*, set_*, update_*, and remove_*. Properties must be manually reset to their default value. The same behavior as when using 'vmadm update'.
Warning
For HVM (bhyve and KVM) brands the image_uuid field should go on the boot disks, this disk should NOT have a size specified. (See man vmadm)
Ensure configuration property is absent in /usbkey/config
name of property
Ensure configuration property is set to value in /usbkey/config
name of property
value of property
Ensure image is absent on the computenode
uuid of image
Note
computenode.image_absent will only remove the image if it is not used by a vm.
Ensure image is present on the computenode
uuid of image
Delete images not in use or installed via image_present
Warning
Only image_present states that are included via the top file will be detected.
Ensure an image source is absent on the computenode
source url
Ensure an image source is present on the computenode
source url
source type (imgapi or docker)
Ensure vm is absent on the computenode
hostname of vm
toggle archiving of vm on removal
Note
State ID is used as hostname. Hostnames must be unique.
Ensure vm is present on the computenode
hostname of vm
options to set for the vm
fine grain control over vm_present
Note
kvm_reboot (true) - reboots of kvm zones if needed for a config update
auto_import (false) - automatic importing of missing images
auto_lx_vars (true) - copy kernel_version and docker:* variables from image
reprovision (false) - reprovision on image_uuid changes
enforce_tags (true) - false = add tags only, true = add, update, and remove tags
enforce_routes (true) - false = add tags only, true = add, update, and remove routes
enforce_internal_metadata (true) - false = add metadata only, true = add, update, and remove metadata
enforce_customer_metadata (true) - false = add metadata only, true = add, update, and remove metadata
Note
State ID is used as hostname. Hostnames must be unique.
Note
If hostname is provided in vmconfig this will take president over the State ID. This allows multiple states to be applied to the same vm.
Note
nic : mac
filesystem: target
disk : path or diskN for zvols
e.g. disk0 will be the first disk added, disk1 the 2nd,...
Changed in version 2019.2.0: Added support for docker image uuids, added auto_lx_vars configuration, documented some missing configuration options.
Ensure vm is in the running state on the computenode
hostname of vm
Note
State ID is used as hostname. Hostnames must be unique.
Ensure vm is in the stopped state on the computenode
hostname of vm
Note
State ID is used as hostname. Hostnames must be unique.