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

Azure version of NixOS blob #36262

Open
Rizary opened this issue Mar 3, 2018 · 23 comments
Open

Azure version of NixOS blob #36262

Rizary opened this issue Mar 3, 2018 · 23 comments
Milestone

Comments

@Rizary
Copy link
Contributor

@Rizary Rizary commented Mar 3, 2018

Hi,

I see from the https://nixos.org/nixos/download.html on the azure section that the version used is 16.03. Meanwhile, its current stable version is 17.09.

Is there any possibility to use 17.09 in azure? How can I contact the nixos azure team for any further question or to contribute in this area?

after reading this #3986, it seems that @Phreedom handle the nixos azure.

also it seems that according to the latest comment here Azure/WALinuxAgent#135, it's been deprecated.

Does building nixos images work for 17.09?

@samueldr
Copy link
Member

@samueldr samueldr commented Oct 10, 2018

Cross-referencing issue:

This is done in the hope that an Azure-knowledgeable user could review that issue. (Sorry I'm not one.)

@colemickens
Copy link
Member

@colemickens colemickens commented Oct 16, 2018

I was using NixOS and Azure during some months this year.

I have some scripts to automate building the image and uploading it to storage as a usable Managed Disk (including creating accounts if they don't exist, etc, etc). It's meant to be "easy". https://github.com/colemickens/nixcfg/tree/master/utils/azure/vhd

Most of the scripts is just orchestrating the build/boot of an Azure machine. Actually building the VHD is basically just a single nix-build call.

The Agent version 2.0 is deprecated. There's a newer version but I don't know enough about packaging and NixOS to really take a crack at it. The old version probably works? In my opinion there's a limited amount of usefulness of the agent under NixOS anyway.

@colemickens
Copy link
Member

@colemickens colemickens commented Oct 16, 2018

(aka, anyone can run those two scripts and create/upload/use a new Azure VHD if they like. I'm not interested in volunteering for maintenance for Azure at this time, though)

@vcunat
Copy link
Member

@vcunat vcunat commented Oct 16, 2018

OK, so building the image seems easy enough, and we have some of the scripts in repo. Upload to https://nixos.blob.core.windows.net/images is probably just a matter of some credentials that someone in here has. Still, all this is probably of little value unless we do at least some basic testing before upload (even automatic tests would seem sufficient).

@vcunat
Copy link
Member

@vcunat vcunat commented Oct 16, 2018

So we might just settle for providing this information instead of the direct download we have now.

@bbarker
Copy link
Contributor

@bbarker bbarker commented Feb 13, 2019

Would there be any possibility of putting something up on Azure Marketplace, e.g., so it would show up with this search? https://azuremarketplace.microsoft.com/en-us/marketplace/apps?search=NixOS&page=1&filters=virtual-machine-images? Even if it is an old image (not actively maintained), it would be super easy for users to just run nixos-rebuild switch --upgrade (I guess maybe after updating one's channels, ideally). Or are there security concerns with leaving outdated images up there?

@bbarker
Copy link
Contributor

@bbarker bbarker commented Feb 13, 2019

(If @colemickens doesn't want to maintain the public images, I'd probably be happy to "maintain" them for a while, as long as I needn't be too diligent, and as long as it doesn't cost beyond minimal $ (sorry, not an Azure user yet, but likely will be soon)).

@matthewbauer matthewbauer added this to the 19.09 milestone May 30, 2019
ghuntley added a commit to ghuntley/nixos-homepage that referenced this issue Jun 9, 2019
note: the vhd v16.03 on the homepage does not work this is being resolved at NixOS/nixpkgs#36262
@ghuntley
Copy link
Member

@ghuntley ghuntley commented Jun 9, 2019

howdy, I'm happy to help out with maintenance as Microsoft provide me with $13k/year of Azure hosting as part their community MVP program. I've sent in NixOS/nixos-homepage#282 which corrects the az cli instructions. This pull-request replaces NixOS/nixos-homepage#226.

@Rizary
Copy link
Contributor Author

@Rizary Rizary commented Jun 9, 2019

@ghuntley hey.. that's cool.. but iirc, we still need to address this Azure/WALinuxAgent#135 issue right?

I haven't test your above PR to create simple NixOS server though...

@idontgetoutmuch
Copy link
Member

@idontgetoutmuch idontgetoutmuch commented Sep 10, 2019

"message": "The VHD for disk 'osdisk_0fbb5e758f' with blob https://nixosvm.blob.core.windows.net/nixosvm/osdisk_0fbb5e758f.vhd has an unsupported virtual size of 30719.390625 MB. The size must be a whole number in (MBs)."
@kim0
Copy link
Contributor

@kim0 kim0 commented Apr 18, 2020

I'm still lost after reading lots of bug reports, exactly how can I launch a nixos VM on Azure ?

@idontgetoutmuch
Copy link
Member

@idontgetoutmuch idontgetoutmuch commented Apr 18, 2020

@kim0 - I think this has the details: https://github.com/NixOS/nixpkgs/tree/master/nixos/maintainers/scripts - I got this working about 6 months ago - I had a few issues and put my notes here: https://github.com/idontgetoutmuch/nix-config#nixos-on-azure but it looks like the instructions have been updated so my notes are probabaly out of date.

@colemickens
Copy link
Member

@colemickens colemickens commented Apr 19, 2020

I recently wrote the new 'azure-new' version that is available in <nixpkgs/nixos/maintainers/scripts/azure-new>. The README in that directory currently has instructions on how to build and boot a custom NixOS image for Azure, and includes an asciinema demo: https://github.com/NixOS/nixpkgs/blob/45948bd56bdbbeb57dbfa76b8a25e5081c564736/nixos/maintainers/scripts/azure-new/README.md

@idontgetoutmuch
Copy link
Member

@idontgetoutmuch idontgetoutmuch commented Apr 22, 2020

@colemickens what happened to the scripts for generating your own images? I have a fork of them here: https://github.com/idontgetoutmuch/nixpkgs/commits/azure-bis but I can't find them your fork or in NixOS.

@kim0
Copy link
Contributor

@kim0 kim0 commented Apr 22, 2020

As a user, I'm not very interested in building my own images. Will there be a way to simply copy/boot existing images soon ? Thanks!

@idontgetoutmuch
Copy link
Member

@idontgetoutmuch idontgetoutmuch commented Apr 23, 2020

error: a 'x86_64-linux' is required to build '/nix/store/d7w2i37vj6gp6q9xh5n59v3nvhijnjck-append-initrd-secrets.drv', but I am a 'x86_64-darwin'
@idontgetoutmuch
Copy link
Member

@idontgetoutmuch idontgetoutmuch commented Apr 23, 2020

I am now on ubuntu but get

sundials@sundials:~/nixpkgs/nixos/maintainers/scripts/azure-new$ ./upload-image.sh ./examples/basic/image.nix
+ image_nix=./examples/basic/image.nix
+ nix-build ./examples/basic/image.nix --out-link azure
error: The option `virtualisation.azureImage' defined in `/home/sundials/nixpkgs/nixos/maintainers/scripts/azure-new/examples/basic/system.nix' does not exist.
(use '--show-trace' to show detailed location information)
@idontgetoutmuch
Copy link
Member

@idontgetoutmuch idontgetoutmuch commented Apr 25, 2020

@kim0 I just built an image and booted up a nixos system on azure just to refresh my memory - it's not too hard :) - have courage - I worked on ubuntu and made sure I had an up to date version of the az cli

@colemickens
Copy link
Member

@colemickens colemickens commented Apr 26, 2020

Hi folks. I understand official images that can be easily booted are desirable. It's what I'm working towards.

Until we get official platform images, we had/have a few options:

  1. Bare minimum: Make it easy to self-build/upload/boot (prerequisite for moving forward; done).

  2. Use Shared Image Galleries, make a little service so that people can grant permission to a NixOS Gallery to their subscription, since I don't think we can make a Gallery image public. This greatly reduces friction, but it's not quite the same as being a platform image and might have implications on image availability and storage costs.

  3. Someone can write the publisher script to push the managed disk blob to storage and make it public; and the consumer script to copy the VHD blob and then make a managed disk from it. I will not be doing this as I think Azure needs to finally finish making disk scenarios work without requiring storage accounts, and I've already written enough bash here to accommodate Azure.

QUESTION: I will probably work on the Shared Image Gallery approach unless people think that's a waste of time. How important is it to you that images are available everywhere, versus maybe having to make a single HTTP request to make them show available to your tenant/subscription?

@idontgetoutmuch
Copy link
Member

@idontgetoutmuch idontgetoutmuch commented Apr 27, 2020

@colemickens the thing that works for me is this: https://github.com/idontgetoutmuch/nix-config#nixos-on-azure using https://github.com/idontgetoutmuch/nixpkgs/commits/azure-bis which is a fork of your work which I can no longer find. I think the new method ought to work for me but sadly didn't: #86005. I've destroyed my ubuntu image so I can't give you any more details without creating a new one. Ideally for me this would all work on macos so I don't have to create an ubuntu image.

My goal was to have nixos running on a GPU machine so I could use tensorflow and https://hackage.haskell.org/package/accelerate via GPU. I don't have a requirement for either of these at the moment but that could easily change.

I am very grateful for all the work you are doing on this. Let me know if I can help somehow but I should warn you I am not very skilled either at nix or azure.

@idontgetoutmuch
Copy link
Member

@idontgetoutmuch idontgetoutmuch commented Apr 28, 2020

Is the idea to have an azure tab like this?

image

(taken from https://nixos.org/download.html)

@Rizary
Copy link
Contributor Author

@Rizary Rizary commented May 16, 2020

@colemickens I think for now we have to make shared image gallery. But do we need to pay for the gallery?

@stale
Copy link

@stale stale bot commented Nov 13, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale label Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
9 participants
You can’t perform that action at this time.