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

[Backup] Add IaasVM ALR/OLR support #21643

Merged
merged 11 commits into from
Mar 21, 2022

Conversation

akshayneema
Copy link
Contributor

@akshayneema akshayneema commented Mar 15, 2022

Description

  • List commands multi-page response bug fix
  • az backup restore restore-disks: Added support for Original Location Restore and Alternate Location Restore (creating new VM)
  • az backup policy create/set/list: Added support for creating and selectively listing Enhanced policies
  • az backup protection enable-for-vm: Added support for Trusted VM configure protection with Enhanced policies

Testing Guide
IaasVM OLR -
az backup restore restore-disks -g {rg} -v {vault} -c {vm} -i {vm} -r {rp} --storage-account {sa} --restore-mode OriginalLocation

IaasVM ALR -
az backup restore restore-disks -g {rg} -v {vault} -c {vm} -i {vm} -r {rp} --storage-account {sa} --restore-mode AlternateLocation --target-vm-name {target_vm_name} --target-vnet-name {vnet_name} --target-subnet-name {subnet_name} --target-vnet-resource-group {target_rg} -t {target_rg}

Selectively listing Enhanced policy -
az backup policy list -g {rg} -v {vault} --policy-sub-type Enhanced

History Notes

[Backup] List commands multi-page response bug fix
[Backup] az backup restore restore-disks: Add support for Original Location Restore and Alternate Location Restore
[Backup] az backup policy create/set/list: Add support for creating and selectively listing Enhanced policies
[Backup] az backup protection enable-for-vm: Add support for Trusted VM configure protection with Enhanced policies


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

@yonzhan
Copy link
Collaborator

yonzhan commented Mar 15, 2022

Backup

if not restore_as_unmanaged_disks and target_resource_group is None:
logger.warning(
if restore_as_unmanaged_disks and target_resource_group is not None:
raise CLIError(
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we use the specific error type instead of CLIError?

Comment on lines 446 to 453
if schedule_run_frequency == 'Hourly':
raise InvalidArgumentValueError(
"""
Hourly IaasVM backups are not allowed from CLI currently. Please try using portal experience for the same.
""")

# Validating range of days input
if schedule_run_frequency == 'Weekly' and retention_range_in_days != 5:
Copy link
Contributor

Choose a reason for hiding this comment

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

if schedule_run_frequency == 'Hourly':
if schedule_run_frequency == 'Weekly'

Could we define enumerations or constants for the values of these variables to facilitate reuse?

Comment on lines -360 to +366
self.check("length(@)", 2)
self.check("length(@)", 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it modified here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed a redundant test case from the test. So had to change it.

@zhoxing-ms
Copy link
Contributor

zhoxing-ms commented Mar 21, 2022

List commands multi-page response bug fix
az backup restore restore-disks: Added support for Original Location Restore and Alternate Location Restore (creating new VM)
az backup policy create/set/list: Added support for creating and selectively listing Enhanced policies
az backup protection enable-for-vm: Added support for Trusted VM configure protection with Enhanced policies

@akshayneema Are these what you want to write into the history notes?

If so, please put the content you want to write into history notes under History Notes in PR description, and refer to this doc submitting-pull-requests to modify the style of those contents

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.

5 participants