Add a virtual disk to KVM

Source: Internet
Author: User

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:

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.