|
1. Using a graphical interface "Virtual Machine Manager" Add a Virtual Disk
2. Character interface:
Add a qcow2
[Root @ localhost ~] # qemu-img create -f qcow2 kvm-clone.qcow2 2G
Formatting 'kvm-clone.qcow2', fmt = qcow2 size = 2147483648 encryption = off cluster_size = 65536
Add disk configuration file:
[Root @ localhost ~] # virsh edit CentOS-virt-clone
virsh edit centos-virt-clone
< Disk type = 'file' device = 'disk'>
< Driver name = 'qemu' type = 'qcow2' cache = 'none' />
< Source file = '/ root / kvm-clone-add.qcow2' />
< Target dev = 'vdb' bus = 'virtio' />
< / Disk>
Open a virtual machine, an error occurs:
[Root @ localhost ~] # virsh start centos-virt-clone
Error: Start Domain centos-virt-clone failed
Error: internal error Process exited while reading console log output: char device redirected to / dev / pts / 2
2015-02-02T11: 13: 45.039620Z qemu-kvm: -drive file = / root / kvm-clone.qcow2, if = none, id = drive-virtio-disk3, format = qcow2, cache = none: could not open disk image /root/kvm-clone.qcow2: Permission denied
Restart "libvirtd"
vim / etc / libvir
user = "root"
# The group for QEMU processes run by the system instance. It can be
# Specified in a similar way to user.
group = "root"
dynamic_ownership = 0
[Root @ localhost ~] # /etc/init.d/libvirtd restart
Open a virtual machine:
[Root @ localhost ~] # virsh start centos-virt-clone
Domain centos-virt-clone has begun
3. Add online virtual disk:
virsh attach-disk oeltest02 /data/test02_add01.qcow2 sdb --cache = none --subdriver = qcow2 |
|
|
|