Skip to content

Commit

Permalink
Update Image Alias with new and remove deprecated (#26408) (#26434)
Browse files Browse the repository at this point in the history
* Introduce new Ubuntu 2404 image alias, and update some old no longer existing images (#26356)

* test not working yet

* test success

* sanitize password in recording

* Update ChangeLog.md

---------

Co-authored-by: Theodore Chang <[email protected]>
Co-authored-by: Adam Sandor <[email protected]>
Co-authored-by: NanxiangLiu <[email protected]>
  • Loading branch information
4 people authored Oct 23, 2024
1 parent 7a0aa86 commit bec78c2
Show file tree
Hide file tree
Showing 4 changed files with 17,679 additions and 1,675 deletions.
112 changes: 86 additions & 26 deletions src/Compute/Compute.Test/ScenarioTests/ImageTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -342,123 +342,183 @@ function Test-DefaultImagesExistManual
# UbuntuLTS test

# Ubuntu2204 test
$vmname = "v1" + $rgname;
$publisher = $images.Linux.Ubuntu2204.publisher;
$offer = $images.Linux.Ubuntu2204.offer;
$sku = $images.Linux.Ubuntu2204.sku;
$version = $images.Linux.Ubuntu2204.version;
$img = Get-AzVMImage -Location $loc -Publisher $publisher -Offer $offer -Sku $sku -Version $version;
Assert-NotNull $img;
New-AzVM -ResourceGroupName MyResourceGroup -Name mytestvm -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Ubuntu2204;
New-AzVM -ResourceGroupName $rgname -Name $vmname -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Ubuntu2204;

# Ubuntu 2404 test
$vmname = "v2" + $rgname;
$publisher = $images.Linux.Ubuntu2404.publisher;
$offer = $images.Linux.Ubuntu2404.offer;
$sku = $images.Linux.Ubuntu2404.sku;
$version = $images.Linux.Ubuntu2404.version;
$img = Get-AzVMImage -Location $loc -Publisher $publisher -Offer $offer -Sku $sku -Version $version;
Assert-NotNull $img;
$vm = New-AzVM -ResourceGroupName $rgname -Name $vmname -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Ubuntu2404;

# Ubuntu 2404 Pro test
$vmname = "v3" + $rgname;
$publisher = $images.Linux.Ubuntu2404Pro.publisher;
$offer = $images.Linux.Ubuntu2404Pro.offer;
$sku = $images.Linux.Ubuntu2404Pro.sku;
$version = $images.Linux.Ubuntu2404Pro.version;
$img = Get-AzVMImage -Location $loc -Publisher $publisher -Offer $offer -Sku $sku -Version $version;
Assert-NotNull $img;
$vm = New-AzVM -ResourceGroupName $rgname -Name $vmname -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Ubuntu2404Pro;

# CentOS versioned test
$vmname = "v4" + $rgname;
$publisher = $images.Linux.CentOS85Gen2.publisher;
$offer = $images.Linux.CentOS85Gen2.offer;
$sku = $images.Linux.CentOS85Gen2.sku;
$version = $images.Linux.CentOS85Gen2.version;
$img = Get-AzVMImage -Location $loc -Publisher $publisher -Offer $offer -Sku $sku -Version $version;
Assert-NotNull $img;
New-AzVM -ResourceGroupName MyResourceGroup -Name mytestvm -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image CentOS85Gen2;
New-AzVM -ResourceGroupName $rgname -Name $vmname -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image CentOS85Gen2;

# Debian versioned test
$vmname = "v5" + $rgname;
$publisher = $images.Linux.Debian11.publisher;
$offer = $images.Linux.Debian11.offer;
$sku = $images.Linux.Debian11.sku;
$version = $images.Linux.Debian11.version;
$img = Get-AzVMImage -Location $loc -Publisher $publisher -Offer $offer -Sku $sku -Version $version;
Assert-NotNull $img;
New-AzVM -ResourceGroupName MyResourceGroup -Name mytestvm -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Debian11;
New-AzVM -ResourceGroupName $rgname -Name $vmname -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Debian11;

# OpenSuseLeap154Gen2 versioned test
$vmname = "v6" + $rgname;
$publisher = $images.Linux.OpenSuseLeap154Gen2.publisher;
$offer = $images.Linux.OpenSuseLeap154Gen2.offer;
$sku = $images.Linux.OpenSuseLeap154Gen2.sku;
$version = $images.Linux.OpenSuseLeap154Gen2.version;
$img = Get-AzVMImage -Location $loc -Publisher $publisher -Offer $offer -Sku $sku -Version $version;
Assert-NotNull $img;
New-AzVM -ResourceGroupName MyResourceGroup -Name mytestvm -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image OpenSuseLeap154Gen2;
New-AzVM -ResourceGroupName $rgname -Name $vmname -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image OpenSuseLeap154Gen2;

# RHELRaw8LVMGen2 test
$vmname = "v7" + $rgname;
$publisher = $images.Linux.RHELRaw8LVMGen2.publisher;
$offer = $images.Linux.RHELRaw8LVMGen2.offer;
$sku = $images.Linux.RHELRaw8LVMGen2.sku;
$version = $images.Linux.RHELRaw8LVMGen2.version;
$img = Get-AzVMImage -Location $loc -Publisher $publisher -Offer $offer -Sku $sku -Version $version;
Assert-NotNull $img;
New-AzVM -ResourceGroupName MyResourceGroup -Name mytestvm -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image RHELRaw8LVMGen2;

# SuseSles15SP3 versioned test
$publisher = $images.Linux.SuseSles15SP3.publisher;
$offer = $images.Linux.SuseSles15SP3.offer;
$sku = $images.Linux.SuseSles15SP3.sku;
$version = $images.Linux.SuseSles15SP3.version;
New-AzVM -ResourceGroupName MyResourceGroup -Name $vmname -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image RHELRaw8LVMGen2;

# SuseSles15SP5 versioned test
$vmname = "v8" + $rgname;
$publisher = $images.Linux.SuseSles15SP5.publisher;
$offer = $images.Linux.SuseSles15SP5.offer;
$sku = $images.Linux.SuseSles15SP5.sku;
$version = $images.Linux.SuseSles15SP5.version;
$img = Get-AzVMImage -Location $loc -Publisher $publisher -Offer $offer -Sku $sku -Version $version;
Assert-NotNull $img;
New-AzVM -ResourceGroupName MyResourceGroup -Name mytestvm -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image SuseSles15SP3;
New-AzVM -ResourceGroupName $rgname -Name $vmname -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image SuseSles15SP5;

# FlatcarLinuxFreeGen2 versioned test
$vmname = "v9" + $rgname;
$computerName = "c" + $rgname;
$publisher = $images.Linux.FlatcarLinuxFreeGen2.publisher;
$offer = $images.Linux.FlatcarLinuxFreeGen2.offer;
$sku = $images.Linux.FlatcarLinuxFreeGen2.sku;
$version = $images.Linux.FlatcarLinuxFreeGen2.version;
$img = Get-AzVMImage -Location $loc -Publisher $publisher -Offer $offer -Sku $sku -Version $version;
Assert-NotNull $img;
New-AzVM -ResourceGroupName MyResourceGroup -Name mytestvm -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image FlatcarLinuxFreeGen2;

$vnetname = "vn" + $rgname;
$vnetAddress = "10.0.0.0/16";
$subnetname = "slb" + $rgname;
$subnetAddress = "10.0.2.0/24";
$NICName = $vmname+ "-nic";
$NSGName = $vmname + "-NSG";


$frontendSubnet = New-AzVirtualNetworkSubnetConfig -Name $subnetname -AddressPrefix $subnetAddress;

$vnet = New-AzVirtualNetwork -Name $vnetname -ResourceGroupName $rgname -Location $loc -AddressPrefix $vnetAddress -Subnet $frontendSubnet;

$nsgRuleRDP = New-AzNetworkSecurityRuleConfig -Name RDP -Protocol Tcp -Direction Inbound -Priority 1001 -SourceAddressPrefix * -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 3389 -Access Allow;
$nsg = New-AzNetworkSecurityGroup -ResourceGroupName $RGName -Location $loc -Name $NSGName -SecurityRules $nsgRuleRDP;
$nic = New-AzNetworkInterface -Name $NICName -ResourceGroupName $RGName -Location $loc -SubnetId $vnet.Subnets[0].Id -NetworkSecurityGroupId $nsg.Id -EnableAcceleratedNetworking;

# VM
$vmConfig = New-AzVMConfig -SecurityType "Standard" -VmSize "Standard_DS3_v2" -Name $vmname;
Set-AzVMOperatingSystem -VM $vmConfig -Windows -ComputerName $vmName -Credential $cred;
Set-AzVMSourceImage -VM $vmConfig -PublisherName "kinvolk" -Offer "flatcar-container-linux-free" -Skus "stable-gen2" -Version "latest" ;
Add-AzVMNetworkInterface -VM $vmConfig -Id $nic.Id;

#New-AzVM -ResourceGroupName $rgname -Location $loc -Vm $vmconfig;
# New-AzVM -ResourceGroupName $rgname -Name $vmname -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image FlatcarLinuxFreeGen2;


# Windows
# Win2022AzureEditionCore test
$vmname = "va" + $rgname;
$publisher = $images.Windows.Win2022AzureEditionCore.publisher;
$offer = $images.Windows.Win2022AzureEditionCore.offer;
$sku = $images.Windows.Win2022AzureEditionCore.sku;
$version = $images.Windows.Win2022AzureEditionCore.version;
$img = Get-AzVMImage -Location $loc -Publisher $publisher -Offer $offer -Sku $sku -Version $version;
Assert-NotNull $img;
New-AzVM -ResourceGroupName MyResourceGroup -Name mytestvm -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Win2022AzureEditionCore;
New-AzVM -ResourceGroupName $rgname -Name $vmname -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Win2022AzureEditionCore;

# Win10 test
$vmname = "vt" + $rgname;
$publisher = $images.Windows.Win10.publisher;
$offer = $images.Windows.Win10.offer;
$sku = $images.Windows.Win10.sku;
$version = $images.Windows.Win10.version;
$img = Get-AzVMImage -Location $loc -Publisher $publisher -Offer $offer -Sku $sku -Version $version;
Assert-NotNull $img;
New-AzVM -ResourceGroupName $rgname -Name $vmname -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Win10;

# Win2019Datacenter test
$vmname = "vd" + $rgname;
$publisher = $images.Windows.Win2019Datacenter.publisher;
$offer = $images.Windows.Win2019Datacenter.offer;
$sku = $images.Windows.Win2019Datacenter.sku;
$version = $images.Windows.Win2019Datacenter.version;
$img = Get-AzVMImage -Location $loc -Publisher $publisher -Offer $offer -Sku $sku -Version $version;
Assert-NotNull $img;
New-AzVM -ResourceGroupName MyResourceGroup -Name mytestvm -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Win2019Datacenter;
New-AzVM -ResourceGroupName $rgname -Name $vmname -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Win2019Datacenter;

# Win2016Datacenter test
$vmname = "vs" + $rgname;
$publisher = $images.Windows.Win2016Datacenter.publisher;
$offer = $images.Windows.Win2016Datacenter.offer;
$sku = $images.Windows.Win2016Datacenter.sku;
$version = $images.Windows.Win2016Datacenter.version;
$img = Get-AzVMImage -Location $loc -Publisher $publisher -Offer $offer -Sku $sku -Version $version;
Assert-NotNull $img;
New-AzVM -ResourceGroupName MyResourceGroup -Name mytestvm -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Win2016Datacenter;
New-AzVM -ResourceGroupName $rgname -Name $vmname -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Win2016Datacenter;

# Win2012R2Datacenter test
$vmname = "vr" + $rgname;
$publisher = $images.Windows.Win2012R2Datacenter.publisher;
$offer = $images.Windows.Win2012R2Datacenter.offer;
$sku = $images.Windows.Win2012R2Datacenter.sku;
$version = $images.Windows.Win2012R2Datacenter.version;
$img = Get-AzVMImage -Location $loc -Publisher $publisher -Offer $offer -Sku $sku -Version $version;
Assert-NotNull $img;
New-AzVM -ResourceGroupName MyResourceGroup -Name mytestvm -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Win2012R2Datacenter;
New-AzVM -ResourceGroupName $rgname -Name $vmname -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Win2012R2Datacenter;

# Win2012Datacenter test
$vmname = "va" + $rgname;
$publisher = $images.Windows.Win2012Datacenter.publisher;
$offer = $images.Windows.Win2012Datacenter.offer;
$sku = $images.Windows.Win2012Datacenter.sku;
$version = $images.Windows.Win2012Datacenter.version;
$img = Get-AzVMImage -Location $loc -Publisher $publisher -Offer $offer -Sku $sku -Version $version;
Assert-NotNull $img;
New-AzVM -ResourceGroupName MyResourceGroup -Name mytestvm -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Win2012Datacenter;
New-AzVM -ResourceGroupName $rgname -Name $vmname -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Win2012Datacenter;

# Win10 test
$publisher = $images.Windows.Win10.publisher;
$offer = $images.Windows.Win10.offer;
$sku = $images.Windows.Win10.sku;
$version = $images.Windows.Win10.version;
$img = Get-AzVMImage -Location $loc -Publisher $publisher -Offer $offer -Sku $sku -Version $version;
Assert-NotNull $img;
New-AzVM -ResourceGroupName MyResourceGroup -Name mytestvm -Location $loc -Credential $cred -DomainNameLabel $domainNameLabel -Image Win10;

}
finally
{
Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Compute/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
-->
## Upcoming Release
* Upgraded Azure.Core to 1.44.1.

* Updated image aliases to be up-to-date in the azure-powershell\src\Compute\Strategies\ComputeRp\Images.json file.
* Upgraded Azure.Core to 1.44.1.

## Version 8.4.0
* Added `SkuProfileVmSize` and `SkuProfileAllocationStrategy` parameters to `New-AzVmss`, `New-AzVmssConfig`, and `Update-AzVmss` cmdlets for VMSS Instance Mix operations.
Expand Down
98 changes: 55 additions & 43 deletions src/Compute/Compute/Strategies/ComputeRp/Images.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,60 @@
{
"Linux": {
"CentOS85Gen2": {
"publisher": "OpenLogic",
"offer": "CentOS",
"sku": "8_5-gen2",
"version": "latest"
},
"Debian11": {
"publisher": "Debian",
"offer": "debian-11",
"sku": "11-backports-gen2",
"version": "latest"
},
"OpenSuseLeap154Gen2": {
"publisher": "SUSE",
"offer": "openSUSE-leap-15-4",
"sku": "gen2",
"version": "latest"
},
"RHELRaw8LVMGen2": {
"publisher": "RedHat",
"offer": "RHEL",
"sku": "8-lvm-gen2",
"version": "latest"
},
"SuseSles15SP3": {
"publisher": "SUSE",
"offer": "sles-15-sp3",
"sku": "gen2",
"version": "latest"
},
"Ubuntu2204": {
"publisher": "Canonical",
"offer": "0001-com-ubuntu-server-jammy",
"sku": "22_04-lts-gen2",
"version": "latest"
},
"FlatcarLinuxFreeGen2": {
"publisher": "kinvolk",
"offer": "flatcar-container-linux-free",
"sku": "stable-gen2",
"version": "latest"
}
"Linux": {
"CentOS85Gen2": {
"publisher": "OpenLogic",
"offer": "CentOS",
"sku": "8_5-gen2",
"version": "latest"
},
"Debian11": {
"publisher": "Debian",
"offer": "debian-11",
"sku": "11-backports-gen2",
"version": "latest"
},
"OpenSuseLeap154Gen2": {
"publisher": "SUSE",
"offer": "openSUSE-leap-15-4",
"sku": "gen2",
"version": "latest"
},
"RHELRaw8LVMGen2": {
"publisher": "RedHat",
"offer": "RHEL",
"sku": "8-lvm-gen2",
"version": "latest"
},
"SuseSles15SP5": {
"publisher": "SUSE",
"offer": "sles-15-sp5",
"sku": "gen2",
"version": "latest"
},
"Ubuntu2204": {
"publisher": "Canonical",
"offer": "0001-com-ubuntu-server-jammy",
"sku": "22_04-lts-gen2",
"version": "latest"
},
"Ubuntu2404": {
"publisher": "Canonical",
"offer": "ubuntu-24_04-lts",
"sku": "server",
"version": "latest"
},
"Ubuntu2404Pro": {
"publisher": "Canonical",
"offer": "ubuntu-24_04-lts",
"sku": "ubuntu-pro",
"version": "latest"
},
"FlatcarLinuxFreeGen2": {
"publisher": "kinvolk",
"offer": "flatcar-container-linux-free",
"sku": "stable-gen2",
"version": "latest"
}
},
"Windows": {
"Win2022AzureEdition": {
"publisher": "MicrosoftWindowsServer",
Expand Down

0 comments on commit bec78c2

Please sign in to comment.