Linux Virtual machine Scripts

Source: Internet
Author: User

#!/bin/bash
Case "$" in
Start
Virsh Start Hello/Turn on virtual machine Holle
;;
Poweroff
Virsh Destroy Hello/Shut down virtual machine Holle
;;
Reboot
Virsh Destroy Hello/Shut down virtual machine
Virsh Start Hello/Open virtual machine
Virt-viewer Hello/Show virtual machine
;;
Teset)
echo Poweroff Hello
Virsh Destroy Hello &>/dev/null/close Snapshot
Echo del hello.xml ...
Virsh undefine Hello &>/dev/null/delete Snapshot
Echo Create Disk ...
Qemu-img create-f qcow2-b/var/lib/libvirt/images/vm1.qcow2/var/lib/libvirt/images/hello.qcow2/ Create a Snapshot
echo Create Hello vm ...
Virt-install \/Get Permissions
--name Hello \/OK name
--ram 2000 \/Determine memory size
--DISK/VAR/LIB/LIBVIRT/IMAGES/HELLO.QCOW2 \/Specify hard drive location
--import &>/dev/null &/Start graphical interface
echo Created Hello successful!!!
;;
View
Virt-viewer Hello/Show virtual machine
Esac

Linux Virtual machine Scripts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.