Skip to content
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

[BUG] VMSS extension can not be created as part of the VMSS Creation request #32599

Closed
desokey opened this issue Nov 22, 2022 · 2 comments · Fixed by #32692
Closed

[BUG] VMSS extension can not be created as part of the VMSS Creation request #32599

desokey opened this issue Nov 22, 2022 · 2 comments · Fixed by #32692
Assignees
Labels
Compute - VMSS customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@desokey
Copy link

desokey commented Nov 22, 2022

Library name and version

Azure.ResourceManager.Compute

Describe the bug

When creating new VMSS using CreateOrUpdate method , and adding CustomScript extension as part of VirtualMachinecaleetData object ,
Creation faild

Expected behavior

Successful Creation

Actual behavior

Object reference not set to an instance of an object. , it complians about a null collection,

at Azure.ResourceManager.Compute.VirtualMachineScaleSetExtensionData.Azure.Core.IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
at Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetExtensionProfile.Azure.Core.IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
at Azure.Core.Utf8JsonWriterExtensions.WriteObjectValue(Utf8JsonWriter writer, IUtf8JsonSerializable value)
at Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetVmProfile.Azure.Core.IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
at Azure.ResourceManager.Compute.VirtualMachineScaleSetData.Azure.Core.IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
at Azure.Core.Utf8JsonWriterExtensions.WriteObjectValue(Utf8JsonWriter writer, IUtf8JsonSerializable value)
at Azure.ResourceManager.Compute.VirtualMachineScaleSetsRestOperations.CreateCreateOrUpdateRequest(String virtualMachineScaleSetName, String subscriptionId, String resourceGroupName, VirtualMachineScaleSetData data)
at Azure.ResourceManager.Compute.VirtualMachineScaleSetsRestOperations.d__9.MoveNext()
at Azure.ResourceManager.Compute.VirtualMachineScaleSetCollection.d__5.MoveNext()

Reproduction Steps

vmssModel.ExtensionProfile = new VirtualMachineScaleSetExtensionProfile()
                        {
                            Extensions =
                           {
                                 new VirtualMachineScaleSetExtensionData("CustomScript")
                                {
                                       AutoUpgradeMinorVersion = true,
                                       EnableAutomaticUpgrade = false,
                                       Settings = BinaryData.FromObjectAsJson(new
                                          {}),
                                       ProvisionAfterExtensions= {},
                                       ProtectedSettings = BinaryData.FromObjectAsJson(new
                                        {
                                               
                                        }),
                                       Publisher = "Microsoft.Azure.Extensions",
                                       ExtensionType = "CustomScript",
                                       TypeHandlerVersion = "2.1"
                                 }
                           }
                        },

Environment

Dotnet

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 22, 2022
@azure-sdk
Copy link
Collaborator

Label prediction was below confidence level 0.6 for Model:ServiceLabels: 'Storage:0.3133556,Azure.Identity:0.057873018,Service Bus:0.047534425'

@ArcturusZhang ArcturusZhang self-assigned this Nov 22, 2022
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Nov 22, 2022
@jsquire jsquire added Mgmt This issue is related to a management-plane library. needs-team-attention This issue needs attention from Azure service team or SDK team labels Nov 22, 2022
@desokey
Copy link
Author

desokey commented Nov 22, 2022

Just to save the team some time , here is my investigation so far
1- The Request complains about the ProvisionAfterExtensions property being null, if you skip this check , you will face another issue , it will complain about the name of the extension is not provided although it is provided in the payload but the Writer does not write the name property in this method Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetExtensionProfile.Azure.Core.IUtf8JsonSerializable.Write

ArcturusZhang added a commit that referenced this issue Nov 28, 2022
* the fix

* update version

* fix serialization to write name as well since it is settable in some cases now

* add a test case for this fix

* revert the mode change
sofiar-msft pushed a commit to sofiar-msft/azure-sdk-for-net that referenced this issue Dec 7, 2022
* the fix

* update version

* fix serialization to write name as well since it is settable in some cases now

* add a test case for this fix

* revert the mode change
@github-actions github-actions bot locked and limited conversation to collaborators Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Compute - VMSS customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants