Description of problem: Customer is unable to provision a VM in Azure when the Image OS is set to Specialized. Version-Release number of selected component (if applicable): Red Hat Satellite 6.8 tfm-rubygem-foreman_azure_rm-2.1.2-1.fm2_1.el7sat.noarch How reproducible: Steps to Reproduce: 1. Hook up Satellite to Azure 2. Create a shared image gallery 3. Create an image and set it to Specialized 4. Try to build a VM with the Azure compute resource Traceback: New error: osProfile is not allowed Failed to create a compute test_raleigh (Azure Resource Manager) instance testvm.example.com: { "message": "MsRestAzure::AzureOperationError: InvalidParameter: Parameter 'osProfile' is not allowed.", "request": { "base_uri": "https://management.azure.com", "path_template": "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", "method": "put", "path_params": { "resourceGroupName": "Images-SC", "vmName": "testvm", "subscriptionId": "xxxxxxxxxxxxxxxxxxxxxx" }, "skip_encoding_path_params": null, "query_params": { "api-version": "2019-03-01" }, "skip_encoding_query_params": null, "headers": { "Content-Type": "application/json; charset=utf-8", "Accept": "application/json", "accept-language": "en-US", "x-ms-client-request-id": "50783a49-5407-4559-8528-460227b6dca6" }, "body": "{\"location\":\"southcentralus\",\"properties\":{\"hardwareProfile\":{\"vmSize\":\"Standard_D2s_v4\"},\"storageProfile\":{\"imageReference\":{\"id\":\"/subscriptions/xxxxxxxxxxxxxxxxxxxxxx/resourceGroups/Images-SC/providers/Microsoft.Compute/galleries/RedHat/images/RHEL8\"},\"osDisk\":{\"osType\":\"Linux\",\"name\":\"testvm-osdisk\",\"createOption\":\"FromImage\",\"managedDisk\":{\"storageAccountType\":\"Premium_LRS\"}},\"dataDisks\":[{\"lun\":1,\"name\":\"testvm-data-disk0\",\"createOption\":\"Empty\",\"diskSizeGB\":\"128\",\"managedDisk\":{}}]},\"osProfile\":{\"computerName\":\"testvm\",\"adminUsername\":\"Admin\",\"adminPassword\":\"Redhat1234\",\"linuxConfiguration\":{\"disablePasswordAuthentication\":false,\"ssh\":{\"publicKeys\":[{\"path\":\"/home/admin/.ssh/authorized_keys\",\"keyData\":\"ssh-rsa food\"}]}}},\"networkProfile\":{\"networkInterfaces\":[{\"id\":\"/subscriptions/xxxxxxxxxxxxxxxxxxxxxx/resourceGroups/Images-SC/providers/Microsoft.Network/networkInterfaces/testvm-nic0\",\"properties\":{\"primary\":true}}]}}}", "middlewares": [ [ "MsRest::RetryPolicyMiddleware", { "times": 3, "retry": 0.02 } ], [ "cookie_jar" ] ], "log": null }, "response": { "body": "{\r\n \"error\": {\r\n \"code\": \"InvalidParameter\",\r\n \"message\": \"Parameter 'osProfile' is not allowed.\",\r\n \"target\": \"osProfile\"\r\n }\r\n}", "headers": { "Cache-Control": "no-cache", "Pragma": "no-cache", "Content-Length": "140", "Content-Type": "application/json; charset=utf-8", "Expires": "-1", "x-ms-ratelimit-remaining-resource": "Microsoft.Compute/PutVM3Min;239,Microsoft.Compute/PutVM30Min;1199", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "x-ms-request-id": "7da71ccb-2c9e-4e02-9cdc-00e43989ed4e", "Server": "Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0", "x-ms-ratelimit-remaining-subscription-writes": "1199", "x-ms-correlation-request-id": "6e4b6d36-7559-43e9-8d4c-f7a87196e498", "x-ms-routing-request-id": "WESTUS2:20210114T141741Z:6e4b6d36-7559-43e9-8d4c-f7a87196e498", "X-Content-Type-Options": "nosniff", "Date": "Thu, 14 Jan 2021 14:17:41 GMT" }, "status": 400 } } Expected results: Additional info: Creating an image definition with the "operating system state" defined to generalized it works.
Created attachment 1759161 [details] Failed image creation with no version in Azure
Created attachment 1759162 [details] Azure specialized image with no version
Created attachment 1759163 [details] Azure specialized image with version
Created attachment 1759164 [details] Specialized image created in Foreman
Created attachment 1759165 [details] Specialized VM listed in Foreman
Looks like a bug currently with the Azure Ruby SDK: Opened an issue here: https://github.com/Azure/azure-sdk-for-ruby/issues/2824
Upstream bug assigned to chrobert