summaryrefslogtreecommitdiff
path: root/subplot/vmadm.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-03-14 07:11:53 +0000
committerLars Wirzenius <liw@liw.fi>2021-03-14 07:11:53 +0000
commite0b2904ef83b5a082f3bae1756bc7633a659c8fc (patch)
treeb4e0698ae9f50b8757530f2332cb1c40872d4a5c /subplot/vmadm.py
parentd4cba41b5674e6ca1cbd5669aeb42d5f7d62e8bd (diff)
parentb8119579a246727805a03c5a8e60fb44109410f6 (diff)
downloadvmadm-e0b2904ef83b5a082f3bae1756bc7633a659c8fc.tar.gz
Merge branch 'iso' into 'main'
fix: VMs can be restarted Closes #17 See merge request larswirzenius/vmadm!19
Diffstat (limited to 'subplot/vmadm.py')
-rw-r--r--subplot/vmadm.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/subplot/vmadm.py b/subplot/vmadm.py
index 6997c5b..dcdcbb6 100644
--- a/subplot/vmadm.py
+++ b/subplot/vmadm.py
@@ -81,6 +81,22 @@ def delete_vm(ctx, config=None, filename=None):
runcmd_exit_code_is_zero(ctx)
+def shutdown_vm(ctx, config=None, filename=None):
+ runcmd_run = globals()["runcmd_run"]
+ runcmd_exit_code_is_zero = globals()["runcmd_exit_code_is_zero"]
+
+ runcmd_run(ctx, ["vmadm", "shutdown", "--config", config, filename])
+ runcmd_exit_code_is_zero(ctx)
+
+
+def start_vm(ctx, config=None, filename=None):
+ runcmd_run = globals()["runcmd_run"]
+ runcmd_exit_code_is_zero = globals()["runcmd_exit_code_is_zero"]
+
+ runcmd_run(ctx, ["vmadm", "start", "--config", config, filename])
+ runcmd_exit_code_is_zero(ctx)
+
+
def run_hostname_over_ssh(ctx, config=None, target=None, args=None):
runcmd_run = globals()["runcmd_run"]
runcmd_exit_code_is_zero = globals()["runcmd_exit_code_is_zero"]