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

nixos/virtualisation/gcp: Use lib/make-disk-image for building Google… #23233

Closed
wants to merge 1 commit into from

Conversation

rickynils
Copy link
Member

… Compute images

Motivation for this change

Code re-use.

Things done
  • Built image file, created a Google Compute Image with it, provisioned a Google Compute VM instance using it.

@mention-bot
Copy link

@rickynils, thanks for your PR! By analyzing the history of the files in this pull request, we identified @rbvermaa, @oconnorr and @Phreedom to be potential reviewers.

PATH=$PATH:${pkgs.stdenv.lib.makeBinPath [ pkgs.gnutar pkgs.gzip ]}
pushd $out
mv nixos.img disk.raw
tar -Szcf "${diskImageBase}.tar.gz" disk.raw
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you not using qcow2?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nlewo Is it supported by Google Compute Engine? It is not really clearly stated, but it looks like only RAW images are supported: https://cloud.google.com/compute/docs/images/import-existing-image. The tar.gz container is explicitly required, though.

Feel free testing/investigating if qcow2 images work. If so, I think it should be part of a different PR/commit though, for easier debugging.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks. They say raw image must be used. In fact, my question was really naive since i don't use gcp:/

Copy link
Contributor

@1pakch 1pakch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a pity this wasn't/isn't merged yet. Is there a specific reason?

IMO, there is a dire need to refactor image building which is really convoluted. This is the logical first step and I use pretty much the same script to build my own images.

EDIT: I see that the similar changes were actually merged. At this moment this PR is obsolete and should be closed.

type = types.int;
default = 100*1024;
description = ''
The size of the disk image built by
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please specify the size unit.

@1pakch
Copy link
Contributor

1pakch commented Nov 16, 2017

Could someone close this as the similar refactoring was merged in 9fae0f3?

EDIT: call @copumpkin who is the author of the above commit

@orivej orivej closed this Nov 16, 2017
@orivej
Copy link
Contributor

orivej commented Nov 16, 2017

That commit is from #25165.

@copumpkin
Copy link
Member

Oh, sorry! I didn't realize this was already a thing or I'd have reused it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants