Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtualisation/hyperv-image: remove diskImage after vhdx is generated #88470

Merged
merged 1 commit into from May 21, 2020

Conversation

@evanjs
Copy link
Member

evanjs commented May 21, 2020

Motivation for this change

Remove the baseImage after the VHDX is generated.

I simply copied the approach taken here

postVM = ''
${pkgs.vmTools.qemu}/bin/qemu-img convert -f raw -o subformat=fixed,force_size -O vpc $diskImage $out/disk.vhd
rm $diskImage
'';

This was discovered when implementing nix-community/nixos-generators#53


This PR solves two issues:

  • We remove the extraneous base image and leave only the VHDX

These are quite large, even with a bare-bones configuration

dr-xr-xr-x root root   3.4 KB Wed Dec 31 19:00:01 1969  .
drwxrwxr-t root nixbld  16 MB Wed May 20 19:34:11 2020  ..
.r--r--r-- root root   1.4 GB Wed Dec 31 19:00:01 1969  nixos-20.09pre226148.0f5ce2fac0c-x86_64-linux.vhdx
.r--r--r-- root root     2 GB Wed Dec 31 19:00:01 1969  nixos.img
  • The VHDX image is printed after nixos-generate completes
    This prints something like /nix/store/36v2px1ca3k2x9q90cr8xzk5bvaqij0v-nixos-hyperv-20.09pre-git-x86_64-linux/nixos-20.09pre-git-x86_64-linux.vhdx
    rather than /nix/store/bx4132wc00d8dg10krslzh27bjm93sf7-nixos-hyperv-20.09pre226148.0f5ce2fac0c-x86_64-linux/nixos.img.

Previously, the base image we were converting would be printed upon image generation.
Now, we are properly given the VHDX file.


Things done

image

@offlinehacker offlinehacker merged commit 9d4e349 into NixOS:master May 21, 2020
14 checks passed
14 checks passed
editorconfig editorconfig
Details
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ef80f34"; rev="ef80f345bed200ba106e58fac4726d235e7bdb3c"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ef80f34"; rev="ef80f345bed200ba106e58fac4726d235e7bdb3c"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ef80f34"; rev="ef80f345bed200ba106e58fac4726d235e7bdb3c"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ef80f34"; rev="ef80f345bed200ba106e58fac4726d235e7bdb3c"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ef80f34"; rev="ef80f345bed200ba106e58fac4726d235e7bdb3c"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ef80f34"; rev="ef80f345bed200ba106e58fac4726d235e7bdb3c"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ef80f34"; rev="ef80f345bed200ba106e58fac4726d235e7bdb3c"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@evanjs evanjs deleted the evanjs:hyperv-remove-base-diskimage branch May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.