azure-sdk-for-go: VMSS Flex VM instances cannot be deleted
Bug Report
Imports:
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute v1.0.0
Package in question:
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute v1.0.0
Go version: 1.19.1
-
What happened? I am trying to delete a VMSS Flex VM instance, but the SDK APIs dont seem functional.
-
What did you expect or want to happen? VM instance deletion process should start and API should succeed.
-
How can we reproduce it? Create VMSS Flex, create instances and try deleting using SDK.
-
Environment
- Current code being tested:
force := true
r, err := vmsClient.BeginDelete(ctx, rgname, vm, &armcompute.VirtualMachinesClientBeginDeleteOptions{
ForceDeletion: &force,
})
if err != nil {
fmt.Println(err)
return
}
I am using the vm client instead of the vmss client api since VMSS API dont seem to support deletion of Flex instances. The VMSS API requires instance IDs that are integers in the backend and those dont exist for the VM Flex instances:
vmssclient.BeginDeleteInstances(ctx, rgname, cpuVmssName, armcompute.VirtualMachineScaleSetVMInstanceRequiredIDs{
InstanceIDs: <REQUIRED; The virtual machine scale set instance ids.>,
}
Response from 1:
Deleting VM: az-cpu-test-wus3-flex-1_3166bfac
DELETE https://management.azure.com/subscriptions/.../providers/Microsoft.Compute/virtualMachines/az-cpu-test-wus3-flex-1_3166bfac
--------------------------------------------------------------------------------
RESPONSE 400: 400 Bad Request
ERROR CODE UNAVAILABLE
--------------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request - Invalid URL</h2>
<hr><p>HTTP Error 400. The request URL is invalid.</p>
</BODY></HTML>
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 19 (7 by maintainers)
Ok i see it happening, in this case the name is the instance IDs. Thank you, you may close this issue.
Ok it looks like that character was getting appended in the go code. It seems to be working now.
I can see some character appended, let me try to fix it and check