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

AzCli support for checkpoint operations and added deleteFromHost flag for VM delete #6300

Merged
merged 10 commits into from
May 29, 2023

Conversation

mchoubey2021
Copy link
Contributor


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

Related command

az scvmm vm create-checkpoint --subscription contoso-sub
--resource-group contoso-rg --name contoso-vm --checkpoint-name contoso-chkpt-name
--checkpoint-description contoso-chkpt-description

az scvmm vm delete-checkpoint --subscription contoso-sub
--resource-group contoso-rg --name contoso-vm --checkpoint-id checkpoint-guid

az scvmm vm restore-checkpoint --subscription contoso-sub
--resource-group contoso-rg --name contoso-vm --checkpoint-id checkpoint-guid

az scvmm vm delete --subscription contoso-sub
--resource-group contoso-rg --name contoso-avset --deleteFromHost

General Guidelines

  • Have you run azdev style <scvmm> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally?

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

@azure-client-tools-bot-prd
Copy link

Hi @mchoubey2021,
If you want to release the new extension version.
Please write the description of changes into HISTORY.rst and update setup.py.

@azure-client-tools-bot-prd
Copy link

Hi @mchoubey2021,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@yonzhan
Copy link
Collaborator

yonzhan commented May 18, 2023

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

@yanzhudd
Copy link
Contributor

Please add test for the new added commands

mchoubey2021 and others added 8 commits May 23, 2023 12:28
Accepted.

Co-authored-by: Yan Zhu <105691024+yanzhudd@users.noreply.github.com>
Co-authored-by: Yan Zhu <105691024+yanzhudd@users.noreply.github.com>
Co-authored-by: Yan Zhu <105691024+yanzhudd@users.noreply.github.com>
Co-authored-by: Yan Zhu <105691024+yanzhudd@users.noreply.github.com>
Co-authored-by: Yan Zhu <105691024+yanzhudd@users.noreply.github.com>
Co-authored-by: Yan Zhu <105691024+yanzhudd@users.noreply.github.com>
@mchoubey2021
Copy link
Contributor Author

Added test cases for newly added scenarios

Comment on lines 156 to 171
self.cmd(
'az scvmm vm create-checkpoint -g {resource_group} --name {vm_name} --checkpoint-name {checkpoint_name} --checkpoint-description {checkpoint_description}',
)
alias_sub = self.cmd('az scvmm vm show -g {resource_group} --name {vm_name}').get_output_in_json()
checkpoint_id = alias_sub['checkpoints'][0]['checkpointId']
self.kwargs.update({'checkpoint_id': checkpoint_id})

self.cmd(
'az scvmm vm restore-checkpoint -g {resource_group} --name {vm_name} --checkpoint-id {checkpoint_id}',
)

self.cmd(
'az scvmm vm delete-checkpoint -g {resource_group} --name {vm_name} --checkpoint-id {checkpoint_id}',
)

self.cmd('az scvmm vm delete -g {resource_group} --name {vm_name} --deleteFromHost -y')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is suggested to add some checks for the commands.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added checks. Pulled vm states and made checks.

@yanzhudd yanzhudd merged commit 4007f2a into Azure:main May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants