Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/QubesOS/qubes-mgmt-salt-dom0-qvm


https://github.com/QubesOS/qubes-mgmt-salt-dom0-qvm

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

===========
QVM Formula
===========

Salt can manage many Qubes settings via the qvm state module.

Management declarations are typically rather simple:

.. code-block:: yaml

appvm:
qvm.prefs
- label: green

.. note::

Also see _modules/ext_module_qvm.py for inline documentation

Available State Commands
========================

.. contents::
:local:

``qvm.exists``
--------------

Verify the named VM is present or exists.
Return True only if the named VM exists. Will not create the VM if missing.

.. code-block:: yaml

qvm.exists:
- name:
- flags:
- quiet

``qvm.missing``
---------------

Verify the named VM is missing.
Return True only if the named VM is missing. Will not remove the VM if present.

.. code-block:: yaml

qvm-missing-id:
qvm.missing:
- name:
- flags:
- quiet

``qvm.running``
---------------

Return True is vmname is running.

.. code-block:: yaml

qvm-running-id:
qvm.running:
- name:

``qvm.halted``
--------------

Return True is vmname is halted.

.. code-block:: yaml

qvm-halted-id:
qvm.halted:
- name:

``qvm.start``
-------------

Start vmname.

.. code-block:: yaml

qvm-start-id:
qvm.start:
- name:
- drive:
- hddisk:
- cdrom:
- custom-config:
- flags:
- quiet # *** salt default ***
- no-guid # *** salt default ***
- tray
- dvm
- debug
- install-windows-tools

``qvm.shutdown``
----------------

Shutdown vmname.

.. code-block:: yaml

qvm-shutdown-id:
qvm.shutdown:
- name:
- exclude: [exclude_list,]
- flags:
- quiet
- force
- wait
- all
- kill

``qvm.kill``
------------

Kill vmname.

.. code-block:: yaml

qvm-kill-id:
qvm.kill:
- name:

``qvm.pause``
-------------

Pause vmname.

.. code-block:: yaml

qvm-pause-id:
qvm.pause:
- name:

``qvm.unpause``
---------------

Unpause vmname.

.. code-block:: yaml

qvm-unpause-id:
qvm.unpause:
- name:

``qvm.present``
---------------

Make sure the named VM is present. VM will be created if missing.

.. code-block:: yaml

qvm-present-id:
qvm.present:
- name:
- template: fedora-21
- label: red
- mem: 3000
- vcpus: 4
- root-move-from:
- root-copy-from:
- flags:
- proxy
- hvm
- hvm-template
- net
- standalone
- internal
- force-root
- quiet

``qvm.absent``
--------------

Make sure the named VM is absent. VM will be deleted (removed) if present.

.. code-block:: yaml

qvm-absent-id:
qvm.absent:
- name:
- flags:
- just-db
- force-root
- quiet

``qvm.clone``
-------------

Clone a VM.

.. code-block:: yaml

qvm-clone-id:
qvm.clone:
- name: -clone
- source:
- path:
- flags:
- shutdown
- quiet
- force-root

``qvm.run``
-----------

Run command in virtual machine domain.

.. code-block:: yaml

qvm-run-id:
qvm.run:
- name:
- cmd: gnome-terminal
- user:
- exclude: [sys-net, sys-firewall]
- localcmd:
- color-output: 31
- flags:
- quiet
- auto
- tray
- all
- pause
- unpause
- pass-io
- nogui
- filter-escape-chars
- no-filter-escape-chars
- no-color-output

``qvm.prefs``
-------------

Set vmname preferences. Use `*default*` special value to reset property to its
default value.

.. code-block:: yaml

qvm-prefs-id:
qvm.prefs:
- name:
- label: orange
- template: debian-jessie
- memory: 400
- maxmem: 4000
- include-in-backups: True
- netvm: sys-firewall
- pcidevs: ['04:00.0']
- kernel: default
- vcpus: 2
- kernelopts: nopat iommu=soft swiotlb=8192
- mac: auto
- debug: true
- virt-mode: hvm
- default-user: tester
- qrexec-timeout: 120
- internal: true
- autostart: true
- flags:
- force-root

List vmname preferences.

.. code-block:: yaml

qvm-prefs-list1-id:
qvm.prefs:
- name:
- action: list

qvm-prefs-list2-id:
qvm.prefs:
- name:

Get vmname preferences.

.. code-block:: yaml

qvm-prefs-get-id:
qvm.prefs:
- name:
- get:
- label
- template
- memory
- maxmem
- include-in-backups

``qvm.service``
---------------

Backward compatibility wrapper. Use features with `service.` prefix.

.. code-block:: yaml

qvm-service-id:
qvm.service:
- name:
- enable:
- test
- test2
- another_test
- another_test2
- another_test3
- disable:
- meminfo-writer
- test3
- test4
- another_test4
- another_test5
- default:
- another_test5
- does_not_exist
# list: []
# list: [string,]

``qvm.features``
---------------

Manage vmname features.

.. code-block:: yaml

qvm-features-id:
qvm.features:
- name:
- enable:
- test
- test2
- another_test
- another_test2
- another_test3
- disable:
- service.meminfo-writer
- test3
- test4
- another_test4
- another_test5
- default:
- another_test5
- does_not_exist
- set:
- example.key: key value
- example.test: test value
# list: []
# list: [string,]

``qvm.tags``
---------------

Manage vmname tags.

.. code-block:: yaml

qvm-tags-id:
qvm.tags:
- name:
- add:
- test
- test2
- another_test
- another_test2
- another_test3
- del:
- test3
- test4
- another_test4
- another_test5
# list: []
# list: [string,]

``qvm.template_installed``
---------------

Ensure given template is installed.

.. code-block:: yaml

qvm-template-installed:
qvm.template_installed:
- name:
- fromrepo:

``qvm.vm``
----------

Wrapper to contain all VM state functions.

- State:

- exists
- missing

- present
- absent
- clone

- prefs
- service
- features
- tags

- Power:

- running
- halted

- start
- shutdown
- kill
- pause
- unpause

- run

Sample test VM creation containing all of the state actions:

.. code-block:: yaml

qvm-vm-id:
qvm.vm:
- name:
- actions:
- kill: pass
- halted: pass
- absent: pass
- missing
- present
- exists
- prefs
- features
- start
- running
- pause
- unpause
- shutdown
- run
- clone
- kill: []
- halted: []
- absent: []
- missing: []
- present:
- template: fedora-21
- label: red
- mem: 3000
- vcpus: 4
- flags:
- proxy
- exists: []
- prefs:
- label: green # red|yellow|green|blue|purple|orange|gray|black
- template: debian-jessie
- memory: 400
- maxmem: 4000
- include-in-backups: false
- netvm: sys-firewall
- features:
- enable:
- test
- test2
- another_test
- another_test2
- another_test3
- disable:
- service.meminfo-writer
- test3
- test4
- another_test4
- another_test5
- default:
- another_test5
- does_not_exist
- tags:
- add:
- tag1
- tag2
- del:
- tag3
- tag4
- start: []
- running: []
- pause: []
- unpause: []
- shutdown: []
- run:
- cmd: gnome-terminal
- flags:
- auto