[BUG] VM is always being created with default OS disk size of128 and not with the specified OS disk size through SDK #47686
Labels
Compute - VM
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
Workflow: 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
Library name and version
Azure.ResourceManager.Compute 1.2.0
Describe the bug
Unable to create an azure virtual machine with a specified OS disk size or update the OS disk size to a specific value using the SDK. The code we use is as per the samples provided in the repo, but it does not work. The virtual machine is always created with the default OS disk size of 128. We are not able to create a VM with an OS disk size greater than 128 GB using the SDK and we are also not able to update the OS disk size to greater than 128 GB using the SDK.
The code we use for create is
VirtualMachineData virtualMachineData = new(task.VirtualMachine.Location)
{
NetworkProfile = new VirtualMachineNetworkProfile()
{
},
HardwareProfile = new VirtualMachineHardwareProfile()
{
VmSize = new VirtualMachineSizeType(task.VirtualMachine.Sku),
},
StorageProfile = new VirtualMachineStorageProfile()
{
OSDisk = new(DiskCreateOptionType.FromImage)
{
DiskSizeGB = 256
}
}
};
Similar behavior for update.
The data disk size also does not update using the SDK.
Expected behavior
The virtual machine at the time of create, should be created with the OS disk size we specify using the SDK, Also when we update the virtual machine, if we specify the OS disk size, it should update to the specified size.
Actual behavior
The OS disk size of the VM does not create with a specified value using the SDK and also it cannot be updated to a specific value using the SDK
Reproduction Steps
Similar code can be used
VirtualMachineData virtualMachineData = new(task.VirtualMachine.Location)
{
NetworkProfile = new VirtualMachineNetworkProfile()
{
},
HardwareProfile = new VirtualMachineHardwareProfile()
{
VmSize = new VirtualMachineSizeType(task.VirtualMachine.Sku),
},
StorageProfile = new VirtualMachineStorageProfile()
{
OSDisk = new(DiskCreateOptionType.FromImage)
{
DiskSizeGB = 256
}
}
};
There are no errors at creation, The VM creates but the disk size always remains at 128.
Environment
No response
The text was updated successfully, but these errors were encountered: