Use the character tool xm to manage xen save, stop, and pause

Source: Internet
Author: User

Use the character tool xm to manage xen save, stop, and pause. Objective: To conveniently manage xen virtual machines by running the xm command. Command list: xm list: list of all known virtual machines xm create: Start an unmanaged Virtual Machine xm top: Provide an overview of the status of all virtual machines xm console: Open the console to manage virtual machines xm new: add a vm to the Xenbase hosting environment xm start: start the VM xm destroy from the Xenbase hosting environment: Close the VM xm shutdown as if it was powered off: Close the VM xm reboot correctly: restart the VM xm pause: pause VM activity without releasing memory resources xm unpause: Activate the pause VM xm save: save the VM status to a file xm restore: restart the VM xm block-attach that has been saved in the file: Add a new hard disk xm block-detach: delete a hard disk. The following describes some important commands (1). display all running virtual machines [root @ localhost ~] # Xm list Name ID Mem (MiB) VCPUs State Time (s) domain-0 0 32768 16 r ----- 210.9 appdata_vm 1 6113 8-B ---- 202.3 rows _vm 2 8191 8-B ---- 31.8 mysql_vm 3 6113 8-B ---- 31.3 queue_vm 4 6113 8-B ---- 31.5 (2) run a virtual machine [root @ localhost ~] # Xm create/etc/xen/appdata_vm Using config file "/etc/xen/appdata_vm". Started domain appdata_vm (3), enter a virtual machine for management [root @ localhost ~] # Xm console appdata_vm (4), disable Virtual Machine [root @ localhost ~] # Xm shutdown appdata_vm (5), restart the VM [root @ localhost ~] # Xm reboot appdata_vm (6), increase the disk space of the xen virtual machine, and use the dd command to create a 30 GB hard disk device. [Root @ localhost ~] # Dd if =/dev/zero bs = 1024 k count = 30720>/data/appdata_vm.img add to Virtual Machine [root @ localhost ~] # Xm block-attach appdata_vm tap: aio:/data/appdata_vm.img xvdb w enter the VM to format and mount the device [root @ localhost ~] # Xm console appdata_vm [root @ localhost ~] # Fdisk-l Disk/dev/xvdb: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065*512 = 8225280 bytes Disk/dev/xvdb doesn't contain a valid partition table found that/dev/xvdb is the hard Disk setting I just added. [Root @ localhost ~] # Mkfs. ext3/dev/xvdb format [root @ localhost ~] # Mount/dev/xvdb/home to the/home directory. View [root @ localhost ~] # Df-h Filesystem Size Used Avail Use % Mounted on/dev/xvda3 6.8G 1.9G 4.6G 30% // dev/xvda1 494 M 18 M 451 M 4%/boot/dev/ xvdb 30G 173 M 28G 1%/home tmpfs 3.0G 0 3.0G 0%/dev/shm my hard drive adds 30G space.
 

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.