-
-
Notifications
You must be signed in to change notification settings - Fork 379
Fully implement CloudInit (Ubuntu) #1552
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
base: develop
Are you sure you want to change the base?
Conversation
7bb5ea6
to
6b771f1
Compare
That was a painful development. I'm not adding any more distributions unless there is at least some standardization 😖 |
Labeling this pull request (PR) as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on this PR is taken up again. |
@raandree ? :) |
Sorry for the delay, @nyanhp. I have just tried the lab you have provided. The deployment wasn't able to reach the Linux VM. Where can I start troubleshooting?
The Linux VM has trouble reaching the internet. I guess I need a network adapter connected to the internet. I am wondering how your lab worked successfully. ![]() |
My lab has a router, in case you didn't try it |
@raandree powershell is not yet available for 23.04. Please use an LTS version. |
Looks like your VM still boots the installation medium. |
If you need/want someone else to test, I am trying to use exactly what you are using (Ubuntu 22.04.03) and run into a similar issue. I downloaded the server installer, and it sits and waits for a cloud-init response, then continues on with the regular install process. I may be able to explain my issue due to the type of networking I'm doing. I'm using a software NAT ( If you need help testing something I'll do what I can to help. I think I may end up using this with some of my colleagues for some training instances so helping to further the cause is in my best interest. :) |
Labeling this pull request (PR) as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on this PR is taken up again. |
🎉 Sorry for the long hiatus @raandree , being a VP is surprisingly time-consuming. I've rethought my approach and now think it works better. The machine's Install VHD is detached and removed after it has shut down during the automated setup. This ensure the VM boots properly, without random issues. I've tested with this beauty as suggested by @dkettman. Remember to use your own SSH keys when testing, @raandree # Lab Variables
$labName = 'MYLAB'
$labSubnet = '172.0.99' #Just the first three octets
$sql_iso_url = 'https://go.microsoft.com/fwlink/p/?linkid=2215158&clcid=0x409&culture=en-us&country=us'
Import-Module AutomatedLab
#checking if our NAT is created. We want internet access!
$nats = Get-NetNat
if ($nats.Count -eq 0) {
Write-ScreenInfo -Message "No NATs defined! Defining one for us!"
New-NetNat -Name $labName -InternalIPInterfaceAddressPrefix $labSubnet'.0/24'
}
else {
Write-ScreenInfo -Message "There is already a NAT defined. Windows can only handle one NAT at a time. (Weak!)"
Write-ScreenInfo -Message "Checking if we can use it..." -TaskStart
if ($nats.InternalIPInterfaceAddressPrefix -like "$labSubnet*") {
Write-ScreenInfo -Message "As far as I can tell, it looks like this should work. If not, remove the NAT using"
Write-ScreenInfo -Message "the 'Remove-NetNAT' cmdlet and restart this script." -TaskEnd
}
else {
Write-ScreenInfo -Message "Looks like this NAT may not work."
Write-ScreenInfo -Message "Please double-check that the existing NAT will and adjust accordingly."
Write-ScreenInfo -Message "Without a NAT configured to handle the $labSubnet.0/24 subnet, you will not have Internets Access" -TaskEnd
break
}
}
#create an empty lab template and define where the lab XML files and the VMs will be stored
New-LabDefinition -Name $labName -DefaultVirtualizationEngine HyperV
#make the network definition
Add-LabVirtualNetworkDefinition -Name $labName -AddressSpace $labSubnet'.0/24'
# Define the Domain and the Domain Administration acocunt
Add-LabDomainDefinition -Name MYLAB.lab -AdminUser cs_admin -AdminPassword Somepass1
# Create a local user on each box as an administrator of 'cs_admin'
Set-LabInstallationCredential -Username cs_admin -Password Somepass1
# Setting up defaults for all machines. These can be overridden when the machine is defined
$PSDefaultParameterValues = @{
'Add-LabMachineDefinition:DomainName' = 'MYLAB.lab'
'Add-LabMachineDefinition:Network' = $labName
'Add-LabMachineDefinition:Gateway' = $labSubnet + '.1'
'Add-LabMachineDefinition:DnsServer1' = $labSubnet + '.10'
'Add-LabMachineDefinition:ToolsPath' = "$labSources\Tools"
'Add-LabMachineDefinition:OperatingSystem' = 'Windows Server 2022 Standard (Desktop Experience)' # GUI by default
}
# Machine Definitions
# DC01
## Roles: RootDC
Add-LabMachineDefinition -Name dc01 `
-Memory 2GB `
-OperatingSystem 'Windows Server 2022 Standard' `
-IpAddress $labSubnet'.10' `
-DomainName MYLAB.lab `
-Roles RootDC, CaRoot
Add-LabMachineDefinition -Name ubuntu01 `
-Memory 8GB `
-Processors 1 `
-IpAddress $labSubnet'.90' `
-SshPublicKeyPath "$home\.ssh\AzurePubKey.pub" `
-SshPrivateKeyPath "$home\.ssh\AzurePubKey" `
-OperatingSystem 'Ubuntu-Server 22.04.3 LTS "Jammy Jellyfish"'
# Get to work!
Install-Lab
|
@raandree there is still a slight timing issue that I cannot quite pinpoint, but in general it works: |
Well, in that case I give up. I have no idea why your VM fails partitioning the disk. I'll give it one last try myself with a new VM to install the lab on. |
@raandree further testing:
|
I know this is a bit stale but thought I would chime in just in case it is somehow helpful. I am using AL and am building some Linux into my lab environment and tried AL (master) but it failed. I then set out to do it manually outside of AL and have that working, and was going to raise a feature request then saw this PR. I found with Ubuntu 24.04.1 I could install it unattended in HyperV easiest by modifying the ISO for the user-data. I do also think a PXE boot option could work for AL since it would need no modification of the ISO, but would need a PXE boot server hosting it (maybe in the lab as a windows router / dhcp server / pxe boot server?). I wrote up my method here: The powershell works ok in my testing, the part I can't figure out is how we would do the ISO modification within AL. I also can't easily work out how you are sorting the cloudinit file in this repo. If you have already figured out a way of taking the ISO then putting the cloudinit inside then repackaging as part of the base build (similar to how you build the windows bases), then I think this could be a solution for Ubuntu 24.04. Probably all problems you have already overcome but I wanted to add if it led to an easier way of sorting the cloudinits (since if we can repackage the iso in here then we would just need different user-data config templates for different ubuntu versions going ahead). |
Labeling this pull request (PR) as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on this PR is taken up again. |
Description
Fixes #1498
Type of change
How was the change tested?