New vmctl module to interface with the OpenBSD VMM hypervisor#45164
New vmctl module to interface with the OpenBSD VMM hypervisor#45164rallytime merged 3 commits intosaltstack:developfrom
Conversation
salt/modules/vmctl.py
Outdated
There was a problem hiding this comment.
A versionadded for Fluorine will be needed for this new file.
salt/modules/vmctl.py
Outdated
There was a problem hiding this comment.
We're moving away from bare salt.utils imports. All of the functions there have been moved over into their own files. Can you update this import to import the individual files needed import salt.utils.x? (And of course update the references in the function calls below.)
The salt.utils.__init__.py file should have the up-to-date paths in the deprecation warnings for each function for reference.
There was a problem hiding this comment.
There was actually only one (salt.utils.path). I'll adjust it.
62fb339 to
1f73701
Compare
|
I've now added tests too. |
eradman
left a comment
There was a problem hiding this comment.
If no argument is passed to vmctl.status then this function mistakenly filters VMs by the name None
[INFO ] Executing command ['vmctl', 'status', None] in directory '/home/eradman'
[TRACE ] stdout: ID PID VCPUS MAXMEM CURMEM TTY OWNER NAME
[DEBUG ] LazyLoaded nested.output
[TRACE ] data = {'local': {}}
salt/modules/vmctl.py
Outdated
There was a problem hiding this comment.
Good point, I had accidentally changed that. It's fixed now.
eradman
left a comment
There was a problem hiding this comment.
There is an edge case not handled here when vmctl reports that the VM is in the state "stopping"
00892c3 to
b33eb37
Compare
|
@eradman I've fixed the edge case too now. Turns out it's a bug in vmctl where it doesn't output the status line for a VM that is stopping when the status is requested for the VM by name (works by id). i.e. |
eradman
left a comment
There was a problem hiding this comment.
@jasperla: previous fixes work. There is another flaw in the way vmctl reports status that causes some confusion. If I start a VM with a name that is already used the output is unclear:
$ doas salt-call --local vmctl.start name=web1 bootpath='/bsd.rd' nics=2 memory=512M disk='/tmp/disk.img'
local:
----------
changes:
True
console:
None
The output from vmctl is not much better
$ doas vmctl start web1 -i 2 -b /bsd.rd -m 512M -d /tmp/disk.img
vmctl: start vm command failed: Operation not permitted
$ echo $?
0
Not sure what this Salt module should do--perhaps we need to parse the status line for this VM?
(saltenv) $ doas vmctl status web1
ID PID VCPUS MAXMEM CURMEM TTY OWNER NAME
12 54520 1 512M 93.3M ttypj root web1
VCPU: 0 STATE: STOPPED
salt/modules/vmctl.py
Outdated
|
@eradman thanks for pointing out that bug in I've now changed So EDIT: tests now pass again too. |
|
Functionally this change seems to be good! |
|
re-run py |
|
re-run py |
|
Looking better now :) |
What does this PR do?
Provide a new module that allows Salt to interact with the OpenBSD VMM hypervisor.
Previous Behavior
NA
New Behavior
This new module implements the following functionality:
Tests written?
No
Commits signed with GPG?
Yes