createVM.sh 452 Bytes
Newer Older
Luhan Wang's avatar
a  
Luhan Wang committed
1
#/bin/bash
Luhan Wang's avatar
Luhan Wang committed
2

Luhan Wang's avatar
a  
Luhan Wang committed
3
ALL_VMS=$(sudo uvt-kvm list)
Luhan Wang's avatar
Luhan Wang committed
4 5 6 7 8 9 10 11
VM_NAME="vmtest"
echo $ALL_VMS
result=$(echo $ALL_VMS | grep "${VM_NAME}")
echo $result
if [ "$result" != "" ];then
    uvt-kvm destroy $VM_NAME  ## if exist testing vm, then remove it
fi
##创建一个虚拟机用于承载测试;
Luhan Wang's avatar
a  
Luhan Wang committed
12 13
uvt-kvm create vmtest release=bionic --memory 8192 --disk 80 --cpu 4 --ssh-public-key-file ~/.ssh/id_rsa.pub
uvt-kvm wait $VM_NAME
Luhan Wang's avatar
a  
Luhan Wang committed
14
echo "successfully created VM, name is vmtest"