improve package process

This commit is contained in:
dima 2015-05-17 19:47:07 +02:00
parent 9ad2389a92
commit 4de1560027
2 changed files with 8 additions and 5 deletions

View File

@ -10,7 +10,7 @@ welcome and can help a lot :-)
## Features
* Control local Libvirt hypervisors.
* Vagrant `up`, `destroy`, `suspend`, `resume`, `halt`, `ssh`, `reload` and `provision` commands.
* Vagrant `up`, `destroy`, `suspend`, `resume`, `halt`, `ssh`, `reload`, `package` and `provision` commands.
* Upload box image (qcow2 format) to Libvirt storage pool.
* Create volume as COW diff image for domains.
* Create private networks.
@ -51,7 +51,7 @@ $ sudo apt-get install libxslt-dev libxml2-dev libvirt-dev zlib1g-dev
In RedHat, Centos, Fedora, ...
```
# yum install libxslt-devel libxml2-devel libvirt-devel
# yum install libxslt-devel libxml2-devel libvirt-devel libguestfs-tools-c
```
If have problem with installation - check your linker. It should be ld.gold:

View File

@ -35,6 +35,9 @@ module VagrantPlugins
env[:ui].info('Image has backing image, copying image and rebasing ...')
FileUtils.cp(root_disk.path, @tmp_img)
`qemu-img rebase -p -b "" #{@tmp_img}`
# remove hw association with interface
# working for centos with lvs default disks
`virt-sysprep --no-logfile -a #{@tmp_img} `
Dir.chdir(@tmp_dir)
img_size = `qemu-img info #{@tmp_img} | grep 'virtual size' | awk '{print $3;}' | tr -d 'G'`.chomp
File.write(@tmp_dir + '/metadata.json', metadata_content(img_size))