Add a virtual disk to KVM
1. Add a virtual disk through the Virtual Machine manager in the graphic interface
2. Character interface:
Add a qcow2
[Root @ localhost ~] # Qemu-img create-f qcow2 Co., kvm-clone.qcow2 2G
Formatting 'kvm-clone. qcow2 ', fmt = qcow2 size = 2147483648 encryption = off cluster_size = 65536
Add a disk to the 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>
An error occurred while enabling the VM:
[Root @ localhost ~] # Virsh start centos-virt-clone
Error: failed to start centos-virt-clone.
Error: internal error Process exited while reading console log output: char device redirected to/dev/pts/2
2015-02-02T11: 13: 45.020.20z qemu-kvm:-drive file =/root/kvm-clone.qcow2, if = none, id = drive-virtio-disk3, format = qcow2, cache = none: cocould not open disk image/root/kvm-clone.qcow2: Permission denied
Restart "libmongod"
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/libmongod restart
Enable virtual machine:
[Root @ localhost ~] # Virsh start centos-virt-clone
Domain centos-virt-clone started
3. Add a virtual disk online:
Virsh attach-disk oeltest02/data/test02_add01.qcow2 sdb -- cache = none -- subdriver = qcow2
View disk partitions:
-------------------------------------- Split line --------------------------------------
How to add a hard disk for a Linux Virtual Machine in KVM
Getting started with Linux: KVM for Virtual Machine experience
RHEL6 KVM virtualization creates a bridge NIC-Bridge
RedHat Linux KVM Virtual Machine bridging
Installation/bridging settings of KVM in CentOS 5.6/virtual machine creation and operation
The/bin/qemu-KVM problem cannot be found when the kvm virtual machine is installed with libvirt In Ubuntu.
Install and configure the KVM Virtual Machine in RedHat6.5
-------------------------------------- Split line --------------------------------------
This article permanently updates the link address: