-
Notifications
You must be signed in to change notification settings - Fork 71
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
Hyper-V: Ubuntu 20.04 #72
Comments
Could you please elaborate on your use case? |
I'm hosting an Appveyor Server and running builds on Hyper-V cloud. Need more detail than that? |
If you have Ubuntu 18.04 image you can just upgrade it to 20.04, right? |
I've only used the commands that Appveyor (When adding Hyper-V cloud) suggests when adding a cloud to build images. I'm not sure I'd know where to start when it comes to manually editing these. |
I imported the image in Hyper-V ran through the upgrade process and appveyor builds stopped working on the upgraded image. I'd appreciate some help on how to go about 'just upgrading' it. |
It's not that trivial to get Hyper-V running on Ubuntu. Typically, it's Hyper-V daemons failing to start on VM boot. For AppVeyor integration it's KVP daemon for exchanging data between host and guest operating systems. It must be running. You may find more info about its troubleshooting here: https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/manage/manage-hyper-v-integration-services#start-and-stop-an-integration-service-from-a-linux-guest |
Those all look fine. The appveyor-build-agent.service complains about not being able to restart /etc/init.d/networking |
I'm struggling to find what is different between the 18.04 and 20.04 VMs. Would appreciate some guidance or a working packer profile for 20.04 since you guys seem to have it running already on your own systems. |
Sure, this is the working script we use to bootstrap Ubuntu image on Hyper-V: https://gist.github.com/FeodorFitsner/4131fdf6e68ab76a0cfc1a4e938c749f It assumes you have a Hyper-V VM with a freshly installed Ubuntu with internet access and Hope that helps. |
That worked! Thank you so much. |
Any plans to create a packer profile for 20.04? |
Based on our experience it's really challenging to make Packer working right with Hyper-V directly from ISO - the whole process usually is unreliable and based on timeouts/retries. Instead, we pre-create "base" VMs manually with just build agent installed (the script from above) and then build images from AppVeyor: https://ci.appveyor.com/project/AppVeyor/build-images-linux Unfortunately, this functionality is not available for BYOC right now (but I think could be easily added), but for "custom build images" only. |
Would be sweet if the image bake (which I'm assuming is what you meant) would be a thing on BYOC. |
On a related note, would it be possible to add the ability to specify how many pre-heated VMs a particular image gets? Once you start getting a few images that only really need one instance it seems to work against you. |
You need to create a separate Hyper-V cloud for each image if you need it pre-heated, ultimately one cloud per image. Re: bake - actually, if you look at build script it's pretty trivial. You can take "base" image with build agent (which I assume you already have and run a few lines while logged into it (from here): curl -fsSL "https://github.com/appveyor/build-images/archive/master.tar.gz" -o scripts.tar.gz
mkdir src && tar -zxf scripts.tar.gz -C src
cd src/build-images-master/scripts/Ubuntu && pwd
sudo -E ./basicconfig.sh That's it - you'll get the same image as we have on production. |
How would you go about creating the separate cloud on the same host? Would the above script save the result as a new image, which is what I assume the bake image functionality was all about. My use case would be to test sub-projects that depend on another project on an image that is dynamically built whenever the the project is updated. |
Add a new Hyper-V cloud and use the same "Host agent authorization token". The script will update VM only and then you copy its VHD and use as an image. |
Any chance an option to build an image using focal could be added?
The text was updated successfully, but these errors were encountered: