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] VM is always being created with default OS disk size of128 and not with the specified OS disk size through SDK #47686

Open
Anjali-nair01 opened this issue Dec 28, 2024 · 1 comment
Assignees
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

Comments

@Anjali-nair01
Copy link

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
}
}
};

            azureVm = (await vms.CreateOrUpdateAsync(WaitUntil.Completed, task.VirtualMachine.ComputerName, virtualMachineData, cancellationToken)).Value;

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
}
}
};

            azureVm = (await vms.CreateOrUpdateAsync(WaitUntil.Completed, task.VirtualMachine.ComputerName, virtualMachineData, cancellationToken)).Value;

There are no errors at creation, The VM creates but the disk size always remains at 128.

Environment

No response

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 28, 2024
@Anjali-nair01 Anjali-nair01 changed the title [BUG] [BUG] VM is always being created with default OS disk size of128 and not with the specified OS disk size through SDK Dec 28, 2024
@jsquire jsquire added Compute - VM 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 and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Dec 28, 2024
@jsquire
Copy link
Member

jsquire commented Dec 28, 2024

Thank you for your feedback. Tagging and routing to the team member best able to assist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants