Skip to content

New Attach/Detach data disks APIs support for VMs and VMSS #38030

Closed
@alexn-orca

Description

@alexn-orca

On the 18th of October Azure introduced the new APIs for attaching and detaching data disks for VMs and VMSS.

I would like to have wrappers on those APIs available in Azure python SDK, to me able to attach/detach data volumes without calling update VM operation.

Currently I do this:

    data_disk_update = (virtual_machine.storage_profile.data_disks or []) + [  # type: ignore
        {
            "lun": len(virtual_machine.storage_profile.data_disks),  # type: ignore  # can be 0-15
            # 'name': volume['name'],
            "create_option": DiskCreateOption.attach,
            "managed_disk": {"id": volume_id},
        }
    ]
    virtual_machine_update = {"storage_profile": {"data_disks": data_disk_update}}
  async_disk_attach = await compute_client.virtual_machines.begin_update(rg_name, vm_name, )
  await async_disk_attach.result()

What I want to be able to do:
async_disk_attach = await compute_client.virtual_machines.attach_volume(rg_name, vm_name, volumes)

Metadata

Metadata

Assignees

Labels

Compute - VMMgmtThis issue is related to a management-plane library.customer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-requestThis issue requires a new behavior in the product in order be resolved.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions