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

[Compute] az vm disk attach-detach-data-disk: Add new attach-detach data disk command #30746

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

nitinjainms
Copy link

Related command
az vm disk attach-detach-data-disk

Description
New API is defined to attach and detach data disk from a Virtual Machine. This PR adds CLI command for the same API.

Testing Guide

Following commands removes an existing data disk from a VM:

az vm disk attach-detach-data-disk --resource-group myResourceGroup --vm-name myVM --data-disks-to-detach [0].disk-id={disk1_id}

History Notes


This checklist is used to make sure that common guidelines for a pull request are followed.

Copy link

Validation for Azure CLI Full Test Starting...

Thanks for your contribution!

Copy link

Validation for Breaking Change Starting...

Thanks for your contribution!

@yonzhan
Copy link
Collaborator

yonzhan commented Feb 3, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

Copy link

github-actions bot commented Feb 3, 2025

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@yanzhudd
Copy link
Contributor

yanzhudd commented Feb 7, 2025

May I ask why need to add these commands? It seems there are already commands to attach/detach disk to/from VM:

with self.command_group('vm disk', compute_vm_sdk, min_api='2017-03-30') as g:
g.custom_command('attach', 'attach_managed_data_disk', validator=process_vm_disk_attach_namespace)
g.custom_command('detach', 'detach_managed_data_disk', validator=process_vm_disk_detach_namespace)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Compute az vm/vmss/image/disk/snapshot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants