[CentOS-devel] Vagrant images for Hyper-V
lpancescu at gmail.com
Mon May 1 06:44:00 UTC 2017
On 01/05/17 05:37, Patrick Lang wrote:
> re: sparse files - NTFS doesn't support sparse files, but Hyper-V does have dynamically expanding VHD and VHDX files. VHDX allocations are configurable but the default of 32MB is tuned to NTFS which puts all metadata at the beginning of the disk. Dropping VHDX allocations down to 1MB helps reduce the slack space left after each inode. VHD uses smaller allocations so it’s less of an issue. Both images are just over a gig on disk which is about what I’d expect.
Image Factory generates VHD images via qemu-img; based on what you
write, we can probably leave that as it is.
> If you’re optimizing the template Vagrantfiles in the boxes, it would be very helpful to add differencing_disk = true to avoid copying the full VHD and reduce IO in vagrant up.
I saw Vagrant has a boolean "differencing_disk" option, probably
defaulting to false. It doesn't mention any disadvantages in having
this enabled by default (e.g. the equivalent VirtualBox option requires
you to manually delete an additional clone VM, against which the Vagrant
boxes create diff images). If this isn't required for Hyper-V, we
should probably enable it.
> Here's what I observed on each image
> Centos 6.1.1 - Vagrant didn't find an IP address upon bootup. I logged in
> via the console and the Hyper-V virtual NIC was on eth1 which didn't have
> dhclient configured. I ran dhclient manually, then vagrant ssh was able to
> find the IP
This is also what Michael reported: eth0 seems to be renamed to eth1
during boot. I assume it's udev doing that; perhaps we have a mismatch
between /etc/udev/rules.d/70-persistent-net.rules and
/etc/sysconfig/network-scripts/ifcfg-eth0 (probably regarding the MAC of
the network card)? We only provide a configuration for eth0, the higher
NICs should be enabled by Vagrant (at least in theory, because it
actually ignores settings like private_networking on Hyper-V, if I
> I haven't fully tested everything but wanted to share some of the results. Let me know if there's a list of tests run against the other boxes and I can go through them.
Our current tests only run 'uname -r' on the boxes, and perhaps a yum
update, to make sure networking to the outside works. Another idea
would be to add private_networking to the Vagrantfile (if that would
work with Hyper-V), install Apache inside the box, and grab the default
static webpage from the host via the private_networking IP.
Thanks, Patrick and Jeff!
More information about the CentOS-devel