KVM虚拟机怎么扩展磁盘空间

本篇内容介绍了“KVM虚拟机怎么扩展磁盘空间”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

本篇内容介绍了“KVM虚拟机怎么扩展磁盘空间”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

让客户满意是我们工作的目标,不断超越客户的期望值来自于我们对这个行业的热爱。我们立志把好的技术通过有效、简单的方式提供给客户,将通过不懈努力成为客户在信息化领域值得信任、有价值的长期合作伙伴,公司提供的服务项目有:国际域名空间、网络空间、营销软件、网站建设、浈江网站维护、网站推广。

KVM支持在线扩展磁盘空间,支持RHEL系列6以上的版本

列出在线虚拟机磁盘

[root@e3 images]# virsh list --all Id    名称                         状态---------------------------------------------------- 29    centos6.6                      running 41    centos6.5                      running -     kvm001                         关闭 -     kvm002                         关闭 -     kvm003                         关闭 -     template                       关闭[root@e3 images]# virsh domblklist centos6.5  #列出在线虚拟机磁盘情况目标     源------------------------------------------------vda        /data/kvm/images/centos6.5.qcow2[root@e3 images]#

创建一块qcow2磁盘并在线添加

[root@e3 images]# qemu-img create -f qcow2 centos6.5-add.qcow2 5G #创建一块5G大小的硬盘Formatting 'centos6.5-add.qcow2', fmt=qcow2 size=5368709120 encryption=off cluster_size=65536 lazy_refcounts=off [root@e3 images]# ll centos6.5-add.qcow2 -rw-r--r--. 1 root root 197120 1月  21 18:31 centos6.5-add.qcow2#在线添加磁盘[root@e3 images]# virsh attach-disk centos6.5 /data/kvm/images/centos6.5-add.qcow2 vdb --cache=none --subdriver=qcow2   ##成功附加磁盘

查看

[root@e3 images]# virsh domblklist centos6.5  目标     源------------------------------------------------vda        /data/kvm/images/centos6.5.qcow2vdb        /data/kvm/images/centos6.5-add.qcow2  #添加成功#切换虚拟机里查看[root@kvm003 ~]# fdisk -lDisk /dev/vda: 32.2 GB, 32212254720 bytes16 heads, 63 sectors/track, 62415 cylindersUnits = cylinders of 1008 * 512 = 516096 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x000903e2   Device Boot      Start         End      Blocks   Id  System/dev/vda1   *           3        1018      512000   83  LinuxPartition 1 does not end on cylinder boundary./dev/vda2            1018       41611    20458496   8e  Linux LVMPartition 2 does not end on cylinder boundary.Disk /dev/mapper/VolGroup-lv_root: 19.9 GB, 19906166784 bytes255 heads, 63 sectors/track, 2420 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000Disk /dev/mapper/VolGroup-lv_swap: 1040 MB, 1040187392 bytes255 heads, 63 sectors/track, 126 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000Disk /dev/vdb: 5368 MB, 5368709120 bytes   #添加的16 heads, 63 sectors/track, 10402 cylindersUnits = cylinders of 1008 * 512 = 516096 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000

标题名称:KVM虚拟机怎么扩展磁盘空间
网站地址:https://www.cdcxhl.com/article34/dhohse.html

成都网站建设公司_创新互联,为您提供自适应网站动态网站标签优化外贸建站营销型网站建设关键词优化

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

小程序开发