Create a new KVM guest VM in the LVM partition using the Clone method

Source: Internet
Author: User
Tags hex code

Virsh List--all

Virsh shutdown boe

Copying VM definition files

==============

Virsh dumpxml boe >/tmp/platform.xml

What needs to be modified: UUID (Uuidgen), name, disk, Mac

uuidgen:4d4e9ccf-4bcc-46e3-be37-63f932875072

http://www.miniwebtool.com/mac-address-generator/: 50:a0:6d:17:bb:5b

Router ARP Binding

==============

192.168.0.11 50:a0:6d:17:bb:5b

Replication partitions (destination partition is greater than source partition)

=============================

Lvdisplay

Lvcreate-l 2.5g-n Platform Lvm_1

Virt-filesystems-lh-a/dev/lvm_1/boe

Virt-resize--expand/dev/sda1/dev/lvm_1/boe/dev/lvm_1/platform

What needs to be modified:/etc/sysconfig/network (host name),/etc/hosts (local DNS),/etc/sysconfig/network-scripts/ifcfg-eth0 (IP address, hostname, MAC address (modified before startup))

Guestfish-i-a/dev/lvm_1/platform

Create a Swap partition

============

Lvcreate-l 1024m-n Platform-swap lvm_1

*******************

Virsh Define/tmp/platform.xml

Virsh Autostart Platform

Virsh Start Platform

Initializing the Swap partition

Fdisk/dev/sdb

Command (M for help): N

Command Action P

Partition number (1-4): 1

.............

Command (M for help): t

Partition number (1-4): 1

Hex code (type L to list codes): L

Hex code (type L to list codes): 82

Command (M for help): W

Mkswap/dev/sdb1

Swapon/dev/sdb1

Cat/proc/swaps

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/

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.