目前公司以raw作为虚拟机模板的储存方式,在部署虚拟机的时候,采用的是LV作为储存设备。这样的好处是可以用于局域网内的服务器共享,也方便在不同服务器上进行传输,单个服务器可以利用lv的快照特性来备份。
关于LVM的介绍,可以参考鸟哥的书关于逻辑卷管理的章节,非常的详细,讲的很清楚 http://vbird.dic.ksu.edu.tw/linux_basic/0420quota_3.php
创建及扩展raw文件
创建4G空的文件
dd if=/dev/zero of=4G.img bs=1024k count=4096
追加到原有的镜像之后
cat vm1.img 4G.img > vm1_new.img
[root@localhost ~]# fdisk -lu conpaas.img
last_lba(): I don't know how to handle files with mode 81a4
You must set cylinders.
You can do this from the extra functions menu.
Disk conpaas.img: 0 MB, 0 bytes
4 heads, 32 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End
关于LVM的介绍,可以参考鸟哥的书关于逻辑卷管理的章节,非常的详细,讲的很清楚 http://vbird.dic.ksu.edu.tw/linux_basic/0420quota_3.php
创建及扩展raw文件
创建4G空的文件
dd if=/dev/zero of=4G.img bs=1024k count=4096
追加到原有的镜像之后
cat vm1.img 4G.img > vm1_new.img
挂在raw文件
在进行虚拟机故障排除的时候非常有用,下面是挂在方法:
[root@localhost ~]# fdisk -lu conpaas.img
last_lba(): I don't know how to handle files with mode 81a4
You must set cylinders.
You can do this from the extra functions menu.
Disk conpaas.img: 0 MB, 0 bytes
4 heads, 32 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End