virsh list --all
virsh shutdown boe
復制vm定義文件
==============
virsh dumpxml boe > /tmp/platform.xml
需要修改的內容:uuid (uuidgen)、 name、 disk、 mac
uuidgen : 4d4e9ccf-4bcc-46e3-be37-63f932875072
http://www.miniwebtool.com/mac-address-generator/ : 50:a0:6d:17:bb:5b
路由器ARP綁定
==============
192.168.0.11 50:a0:6d:17:bb:5b
復制分區(目標分區大於源分區)
=============================
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
需要修改的內容: /etc/sysconfig/network (主機名)、/etc/hosts(本地dns)、 /etc/sysconfig/network-scripts/ifcfg-eth0(ip地址,主機名,mac地址(啟動前修改) )
guestfish -i -a /dev/LVM_1/platform
創建swap分區
============
lvcreate -L 1024M -n platform-swap LVM_1
*******************
virsh define /tmp/platform.xml
virsh autostart platform
virsh start platform
初始化swap分區
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