CNWHUD/shell-frags/RackRentalVirtualPowerMgmt/kvm-PowerCycle.sh

12 lines
231 B
Bash
Raw Normal View History

2023-11-25 18:44:05 +00:00
#!/bin/bash
VMHOSTFULL="$1"
USER_SUPPLIED_VMNAME="$2"
SSH_ALIAS="ssh -q"
VIRSH_ALIAS="virsh -c qemu+ssh://root@$VMHOSTFULL/system?no_verify=1"
$VIRSH_ALIAS destroy $USER_SUPPLIED_VMNAME
$VIRSH_ALIAS start $USER_SUPPLIED_VMNAME