-
Notifications
You must be signed in to change notification settings - Fork 175
mantle/platform/azure: Add support for Azure Shared Image Gallery (SIG) and other enhancements #4109
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: main
Are you sure you want to change the base?
Conversation
b76e3db
to
8c1c513
Compare
8c1c513
to
18626cb
Compare
Introduce a new test verifies that udev rules[1] for Azure Managed NVMe disks correctly create symlinks in `/dev/disk/azure`. It only runs on Azure and uses new kola functionality[2] to override the instance type, enabling the use of a Hyper-V Gen2 VM (Standard_M16bds_v3) with a UltraSSD_LRS (NVMe) data disk attached. The test checks for the presence of expected symlinks: - /dev/disk/azure/os - /dev/disk/azure/data/by-lun/0 [1]: coreos#3378 [2]: coreos/coreos-assembler#4109
Introduce a new test which verifies that udev rules[1] for Azure Managed NVMe disks correctly create symlinks in `/dev/disk/azure`. It only runs on Azure and uses new kola functionality[2] to override the instance type, enabling the use of a Hyper-V Gen2 VM (Standard_M16bds_v3) with a UltraSSD_LRS (NVMe) data disk attached. The test checks for the presence of expected symlinks: - /dev/disk/azure/os - /dev/disk/azure/data/by-lun/0 [1]: coreos#3378 [2]: coreos/coreos-assembler#4109
18626cb
to
9131ca7
Compare
Expand the job to build Hyper-V Gen2 gallery images and run kola tests on both traditional managed images and new Gen2 gallery images[1]. The new NVMe test[2] is explicitly denylisted from managed image testing since since it requires Gen2 support. This will essentially allow all Azure kola tests to be validated on both kinds of images. A pipeline config variable, `test_gallery`, is introduced to the Azure section to specify the gallery used to create Gen2 images. [1]: coreos/coreos-assembler#4109 [2]: coreos/fedora-coreos-config#3519
Introduce a new test which verifies that udev rules[1] for Azure Managed NVMe disks correctly create symlinks in `/dev/disk/azure`. It only runs on Azure and uses new kola functionality[2] to override the instance type, enabling the use of a Hyper-V Gen2 VM (Standard_M16bds_v3) with a UltraSSD_LRS (NVMe) data disk attached. The test checks for the presence of expected symlinks: - /dev/disk/azure/os - /dev/disk/azure/data/by-lun/0 [1]: coreos#3378 [2]: coreos/coreos-assembler#4109
/retest rhcos |
@marmijo: The
Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/test rhcos |
Introduce a new test which verifies that udev rules[1] for Azure Managed NVMe disks correctly create symlinks in `/dev/disk/azure`. It only runs on Azure and uses new kola functionality[2] to override the instance type, enabling the use of a Hyper-V Gen2 VM (Standard_M16bds_v3) with a UltraSSD_LRS (NVMe) data disk attached. The test checks for the presence of OS and data disk symlinks, and that they point to a valid target. [1]: coreos#3378 [2]: coreos/coreos-assembler#4109
9131ca7
to
a5edc64
Compare
return err | ||
} | ||
|
||
// example: ["10G:sku=UltraSSD_LRS"], the default disk type is "Standard_LRS" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other functions describe what the function is doing too. Maybe we can do that in addition to the example?
@@ -272,3 +286,45 @@ func (a *API) GetConsoleOutput(name, resourceGroup, storageAccount string) ([]by | |||
|
|||
return io.ReadAll(data) | |||
} | |||
|
|||
func (a *API) AttachDiskToInstance(instanceName, resourceGroup, diskName string, sku armcompute.DiskStorageAccountTypes, sizeGB int32, lun int32) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function name is already long, but might be nice to be more accurate. Suggestion: CreateAndAttachDiskToInstance()
.
@@ -44,6 +45,7 @@ func init() { | |||
sv := Azure.PersistentFlags().StringVar | |||
sv(&azureCredentials, "azure-credentials", "", "Azure credentials file location (default \"~/"+auth.AzureCredentialsPath+"\")") | |||
sv(&azureLocation, "azure-location", "westus", "Azure location (default \"westus\")") | |||
sv(&azureHyperVGen, "azure-hyper-v-generation", "V1", "Azure Hypervisor Generation") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be happy not supporting an option here and just hardcoding v2 if that's achievable.
@@ -101,6 +101,7 @@ func init() { | |||
sv(&kola.AzureOptions.Location, "azure-location", "westus", "Azure location (default \"westus\"") | |||
sv(&kola.AzureOptions.Size, "azure-size", "Standard_D2_v2", "Azure machine size (default \"Standard_D2_v2\")") | |||
sv(&kola.AzureOptions.AvailabilityZone, "azure-availability-zone", "1", "Azure Availability Zone (default \"1\")") | |||
sv(&kola.AzureOptions.HyperVGeneration, "azure-hyper-v-generation", "V1", "Azure Hyper-V Generation (default \"V1\")") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be part of the previous commit?
Short: "Create Azure Gallery image", | ||
Long: "Create Azure Gallery image from a blob url", | ||
RunE: runCreateGalleryImage, | ||
Aliases: []string{"create-gallery-image-arm"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is having the alias useful or confusing?
} | ||
|
||
// Create a Gallery Image Version | ||
versionName := "1.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely will want to update this when we start publishing images for other people to use.
versionPager := a.galImgVerClient.NewListByGalleryImagePager(resourceGroup, galleryName, imageName, nil) | ||
for versionPager.More() { | ||
versionPage, err := versionPager.NextPage(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future we'll definitely want to be able to delete a specific version of an image from an image gallery.
i.e. we'd call ore
from cosa coreos-prune
code to delete old versions of CoreOS we don't want to keep around any longer.
var ipProperties *armnetwork.PublicIPAddressPropertiesFormat | ||
var ipZones []*string | ||
|
||
// set SKU=Standard, Zllocation Method=Static and Availability Zone on public IPs when creating Gen2 images |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zllocation
-> Allocation
?
Name: to.Ptr(armnetwork.PublicIPAddressSKUNameStandard), | ||
} | ||
ipProperties = &armnetwork.PublicIPAddressPropertiesFormat{ | ||
PublicIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't dynamically assign IPs on gen2?
var size string | ||
if opts.InstanceType != "" { | ||
size = opts.InstanceType | ||
} else { | ||
size = a.opts.Size | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this could use a comment.
We're basically overriding the kola set size with the one from the external test config?
@marmijo: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Add support for attaching additional data disks to instances created in Azure. Disks are defined through the machines options as the Size in GB and the 'sku', or storage type, e.g. '["100G:sku=UltraSSD_LRS"]' for NVMe disks.
Add a new flag to allow specifying the Hyper-V generation (V1 or V2) when creating Azure images. This enables support for both Gen1 and Gen2 image creation.
Add a new `create-gallery-image` ore command to Support creating images within Azure Shared Image Galleries (Gallery Images). The command creates image definitions and versions in Azure Shared Image Galleries. Gallery images can be created from either a blob URL or an existing managed image. A `--azure-publisher` flag is added to assign a publisher to the gallery image. `delete-gallery-image` is also added to delete individual gallery images or an entire Shared Image Gallery.
Add an `InstanceType` field to `PlatformOptions` to allow external tests to override the instance type used in `kola run`. This is useful for cases where a specific test needs to run on a different (potentially more expensive) instance type. Support for this is currently limited to the Azure Platform. Also, fix the `MultiPathDisk` check for the qemu-iso platform. The check is now correctly performed in the `NewMachineWithOptions` function, since `MultiPathDisk` is part of `platform.MachineOptions`.
a5edc64
to
839442c
Compare
This PR introduces support for building and running Azure Shared Image Gallery (SIG) images, also known as "gallery images", alongside traditional managed images. Both image types can now be used with either Hyper-V Generation 1 or Generation 2.
Additional enhancements include:
Support for overriding the instance type per kola test via external test configuration (useful for tests requiring specific VM sizes).
Ability to attach additional data disks to Azure instances, as specified in kola tests.
This enables testing the Azure disk udev rules that were added in coreos/fedora-coreos-config#3378, as NVMe support is only available on Gen2 Gallery Images.
See: https://issues.redhat.com/browse/COS-3125