[root@kvm ~]# virt-clone -o vm1 -n vm2 -f /home/kvm/images/vm2.img WARNING The requested volume capacity will exceed the available pool space when the volume is fully allocated. (10240 M requested capacity > 3844 M available) WARNING The requested volume capacity will exceed the available pool space when the volume is fully allocated. (10240 M requested capacity > 3844 M available) Allocating 'vm2.img' | 10 GB 00:52
Clone 'vm2' created successfully.
3.然后查看虚拟机列表
[root@kvm ~]# virsh list --all Id Name State ---------------------------------------------------- - vm1 shut off - vm2 shut off
4.我们启动虚拟机,并且通过console 连接,
[root@kvm ~]# virsh console vm2 Connected to domain vm2 Escape character is ^] Welcome to CentOS Starting udev: G[ OK ] Setting hostname vm1: [ OK ] Setting up Logical Volume Management:2 logical volume(s) in volume group "vg_vm1" now active [ OK ] Checking filesystems Checking all file systems. [/sbin/fsck.ext4 (1) -- /] fsck.ext4 -a /dev/mapper/vg_vm1-lv_root /dev/mapper/vg_vm1-lv_root: clean, 23060/558624 files, 267724/2230272 blocks [/sbin/fsck.ext4 (1) -- /boot] fsck.ext4 -a /dev/sda1 /dev/sda1: clean, 38/128016 files, 57869/512000 blocks [ OK ] Remounting root filesystem in read-write mode: [ OK ] Mounting local filesystems: [ OK ] Enabling /etc/fstabswaps: [ OK ] Entering non-interactive startup Starting monitoring for VG vg_vm1:2 logical volume(s) in volume group "vg_vm1" monitored [ OK ] ip6tables: Applying firewall rules: [ OK ] iptables: Applying firewall rules: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization. [FAILED] Starting auditd: [ OK ] Starting system logger: [ OK ] Mounting filesystems: [ OK ] Retrigger failed udev events[ OK ] Adding udev persistent rules[ OK ] Starting kdump:[FAILED] Starting sshd: [ OK ] Starting postfix: [ OK ] Starting crond: [ OK ]
CentOS release 6.8 (Final) Kernel 2.6.32-642.el6.x86_64 on an x86_64
vm1 login: root Password: Last login: Sun Mar 1918:28:16 on ttyS0 [root@vm1 ~]#
[root@vm1 ~]# service network restart Shutting down loopback interface: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interfaceeth0: Deviceeth0doesnotseemtobepresent, delayinginitialization. [FAILED]