Skip to content

Commit

Permalink
Use default qemu for azure image generation, and use option to enforc…
Browse files Browse the repository at this point in the history
…e sizing of image to be compliant with Azure/HyperV.
  • Loading branch information
rbvermaa committed Feb 13, 2017
1 parent d375f42 commit e16db56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nixos/modules/virtualisation/azure-image.nix
Expand Up @@ -16,14 +16,14 @@ in
cyl=$(((${diskSize}*1024*1024)/(512*63*255)))
size=$(($cyl*255*63*512))
roundedsize=$((($size/(1024*1024)+1)*(1024*1024)))
${pkgs.vmTools.qemu-220}/bin/qemu-img create -f raw $diskImage $roundedsize
${pkgs.vmTools.qemu}/bin/qemu-img create -f raw $diskImage $roundedsize
mv closure xchg/
'';

postVM =
''
mkdir -p $out
${pkgs.vmTools.qemu-220}/bin/qemu-img convert -f raw -O vpc $diskImage $out/disk.vhd
${pkgs.qemu}/bin/qemu-img convert -f raw -o force_size -O vpc $diskImage $out/disk.vhd
rm $diskImage
'';
diskImageBase = "nixos-image-${config.system.nixosLabel}-${pkgs.stdenv.system}.raw";
Expand Down

0 comments on commit e16db56

Please sign in to comment.