qubesadmin.vm package¶
Module contents¶
Qubes VM objects.
- class qubesadmin.vm.DispVM(app, name, klass=None, power_state=None)[source]¶
Bases:
QubesVM
Disposable VM
- class qubesadmin.vm.DispVMWrapper(app, name, klass=None, power_state=None)[source]¶
Bases:
QubesVM
Wrapper class for new DispVM, supporting only service call
Note that when running in dom0, one need to manually kill the DispVM after service call ends.
- class qubesadmin.vm.QubesVM(app, name, klass=None, power_state=None)[source]¶
Bases:
PropertyHolder
Qubes domain.
- property appvms¶
Returns a generator containing all domains based on the current TemplateVM.
Do not check vm type of self, core (including its extentions) have ultimate control what can be a template of what.
- property connected_vms¶
Return a generator containing all domains connected to the current NetVM.
- property derived_vms¶
Return list of all domains based on the current TemplateVM at any level of inheritance.
- devices = None¶
- features = None¶
- firewall = None¶
- get_power_state()[source]¶
Return power state description string.
Return value may be one of those:
return value
meaning
'Halted'
Machine is not active.
'Transient'
Machine is running, but does not have guid or qrexec available.
'Running'
Machine is ready and running.
'Paused'
Machine is paused.
'Suspended'
Machine is S3-suspended.
'Halting'
Machine is in process of shutting down (OS shutdown).
'Dying'
Machine is in process of shutting down (cleanup).
'Crashed'
Machine crashed and is unusable.
'NA'
Machine is in unknown state.
See also
- http://wiki.libvirt.org/page/VM_lifecycle
Description of VM life cycle from the point of view of libvirt.
- https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainState
Libvirt’s enum describing precise state of a domain.
- is_halted()[source]¶
Check whether this domain’s state is ‘Halted’ :returns:
True
if this domain is halted,False
otherwise. :rtype: bool
- property klass¶
Qube class
- log = None¶
- property name¶
Domain name
- prepare_input_for_vmshell(command, input=None)[source]¶
Prepare shell input for the given command and optional (real) input
- run(command, input=None, **kwargs)[source]¶
Run a shell command inside the domain using qubes.VMShell qrexec.
- run_service(service, **kwargs)[source]¶
Run service on this VM
- Parameters:
service (str) – service name
- Return type:
- run_service_for_stdio(service, input=None, **kwargs)[source]¶
Run a service, pass an optional input and return (stdout, stderr).
Raises an exception if return code != 0.
args and kwargs are passed verbatim to
run_service()
.Warning
There are some combinations if stdio-related kwargs, which are not filtered for problems originating between the keyboard and the chair.
- run_with_args(*args, **kwargs)[source]¶
Run a single command inside the domain. Use the qubes.VMExec qrexec, if available.
This method execute a single command, without interpreting any shell special characters.
- tags = None¶
- property volumes¶
VM disk volumes