diff --git a/cloudcontrol/cli/commands/vm.py b/cloudcontrol/cli/commands/vm.py index f42dff0842e5bc2ab83b3eedde52a53a27e51786..8beda7e1c32f9d8065903cb1eb5ecc448d344d20 100644 --- a/cloudcontrol/cli/commands/vm.py +++ b/cloudcontrol/cli/commands/vm.py @@ -120,6 +120,25 @@ class Command_resume(TqlCommand): def remote_functions(self): return set(("resume",)) +class Command_reset(TqlCommand): + '''Reset a running vm''' + + def __init__(self, cli, argv0): + TqlCommand.__init__(self, cli, argv0) + self.tql_filter += "&r=vm&status=running" + + def __call__(self, argv): + # arg parse + self.parse_args(argv) + if len(self.args) != 1: + raise cmdBadArgument() + # rpc call + self.rpccall("reset", self.args[0]) + + def remote_functions(self): + return set(("reset",)) + + class Command_disablevirtiocache(TqlCommand): '''Set virtio cache to none on VMs disk devices'''