随笔分类 - glance
摘要:file injection代码file injection原理来讲是比较简单的,在nova boot命令中,有参数--file,是将文件inject到image中nova boot --flavor 2 --image d96b0e41-8264-41de-8dbb-6b31ce9bfbfc --...
阅读全文
摘要:guestmount root# guestmount -a ubuntutest1.img -m /dev/sda1 ubuntutestp1 root# cd ubuntutestp1/root:/home/cliu8/images/ubuntutestp1# lsa b c d hello lost+found worldroot:/home/cliu8/images/ubuntutest...
阅读全文
摘要:添加一个drive:guestfs_add_drive_optsadd-drive filename [readonly:true|false] [format:..] [iface:..] [name:..] [label:..] [protocol:..] [server:..]This function adds a disk image called filename to the han...
阅读全文
摘要:要编辑一个image,则运行下面的命令 guestfish -a ubuntutest.img > 会弹出一个命令行工具 运行run > run 我们来ps一下进程 root# ps aux | grep guestroot 11697 0.0 0.0 96216 4604 pts/0 S+ 02:14 0:00 guestfish -a ubuntutest.imgroot 11832 7.0 ...
阅读全文
摘要:方法一:mount成为一个loop device 参考http://smilejay.com/2012/08/mount-an-image-file/ 方法一:找出分区开始的开始位置,使用mount命令的offset参数偏移掉前面不需要的,即可得到真正的分区。其具体步骤如下:1. 用“fdisk -lu my.img”查询image信息;2. 计算image内分区开始的地方(计算offset),用...
阅读全文
摘要:网络块设备是通过NBD Server将虚拟块设备通过TCP/IP export出来,可以远程访问。 NBD Server通常是qemu-nbd 可以提供unix socket qemu-nbd -t -k /home/cliu8/images/ubuntutest-nbd ubuntutest.img 打开另一个窗口,可以连接这个unix socket qemu-system-x86_64 -e...
阅读全文
摘要:前面讲了QEMU的qcow2格式的internal snapshot和external snapshot,这都是虚拟机文件格式的功能。 这是文件级别的。 还可以是文件系统级别的,比如很多文件系统支持snapshot,如OCFS2 还可以是block级别的,比如LVM支持snapshot 我们这节来分析openstack中各种snapshot的实现。 在Openstack中,Instance的启动大...
阅读全文
摘要:RAW raw是默认的格式,格式简单,容易转换为其他的格式。需要文件系统的支持才能支持sparse file 创建image # qemu-img create -f raw flat.img 10GFormatting 'flat.img', fmt=raw size=10737418240 如果我们ls则看到 ls -lh flat.img -rw-r--r-- 1 root root 1...
阅读全文
摘要:http://www.cloudbase.it/create-windows-openstack-images/We get regularly a lot of requests about how to generate Windows OpenStack images, especially ...
阅读全文
摘要:Volume managersSome Unix systems have snapshot-capable logical volume managers. These implement copy-on-write on entire block devices by copying chang...
阅读全文
摘要:http://kashyapc.com/2011/10/04/snapshotting-with-libvirt-for-qcow2-images/ Libvirt 0.9.6 was recently out. Take a look at 0.9.5 changelog for truckload of features/bugfixes/cleanups(specifically snaps...
阅读全文
摘要:http://kashyapc.com/ Raw image is a blob of data exposed directly in VM as block device, it can't snapshot. qemu-img is able to import data from raw image into qcow2 image, and save it as snapshot Pr...
阅读全文