您好,登錄后才能下訂單哦!
#!/bin/bash
case $1 in
"view")
echo "view the $2"
virsh-viewer $2
;;
"start")
virsh start $2
echo "start the $2"
;;
"shutdown")
virsh start $2 &
echo "shutdown the $2"
;;
"destroy")
virsh destroy $2 &
echo "destroy the $2"
;;
"reset")
echo poweroff $2 ...
virsh destroy $2 &>/dev/null
echo del $2.xml ...
virsh undefine $2 &> /dev/null
echo create disk ...
qemu-img create -f qcow2 -b /var/lib/libvirt/p_w_picpaths/$2.qcow2 /var/lib/libvirt/p_w_picpaths/$3.qcow2 &> /dev/null
echo create $2 vm ...
virt-install \
--name $3 \
--ram 1000 \
--disk /var/lib/libvirt/p_w_picpaths/$3.qcow2 \
--import &> /dev/null &
echo Reset Successful!
;;
"")
echo "You must input parameters!"
;;
esac
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。