Skip to content

Conversation

@akshayneema
Copy link
Contributor

@akshayneema akshayneema commented Jan 15, 2021

Description
Added Cross Region Restore functionality in the CLI command for IaaSVM restore(restore-disks). Added other CRR commands for enabling CRR on a vault, list/show containers in secondary region, list/show items in secondary region, list/show RPs in secondary region, list/show jobs in secondary region, etc. azure-mgmt-recoveryservicesbackup SDK version has been updated to 0.11.0 from 0.6.0 for the same.

Testing Guide

  • az backup vault backup-properties set -g {rg} -n {vault} --cross-region-restore-flag {True/False}
  • az backup restore restore-disks -g {rg} -v {vault} -c {container} -i {item} -r {rp} --storage-account {storage_account} -t {target_rg} --use-secondary-region
  • az backup item list -g {rg} -v {vault} -c {conatiner} --backup-management-type {AzureWorkload/AzureIaasVM} --workload-type {MSSQL/SAPHANA/VM} --use-secondary-region
  • az backup container show -g {rg} -v {vault} -n {conatiner} --backup-management-type {AzureWorkload/AzureIaasVM} --use-secondary-region
  • az backup recoverypoint list -g {rg} -v {vault} -c {container} -i {item} --backup-management-type {AzureWorkload/AzureIaasVM} --workload-type {MSSQL/SAPHANA/VM} --use-secondary-region
  • az backup job wait -g {rg} -v {vault} -n {job_id} --use-secondary-region

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.


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

@yonzhan
Copy link
Collaborator

yonzhan commented Jan 15, 2021

BACKUP

@akshayneema akshayneema marked this pull request as ready for review January 17, 2021 11:03
with self.argument_context('backup vault backup-properties set') as c:
c.argument('backup_storage_redundancy', arg_type=get_enum_type(['GeoRedundant', 'LocallyRedundant']), help='Sets backup storage properties for a Recovery Services vault.')
c.argument('soft_delete_feature_state', arg_type=get_enum_type(['Enable', 'Disable']), help='Set soft-delete feature state for a Recovery Services Vault.')
c.argument('cross_region_restore_flag', arg_type=get_enum_type(["True", "False"]), help='Set cross-region-restore feature state for a Recovery Services Vault. Default: False.')
Copy link
Member

Choose a reason for hiding this comment

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

cross_region_restore_flag will be treated as a str, you may need to convert it to bool before you pass it to SDK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did the changes. Please review once.

with self.argument_context('backup container show') as c:
c.argument('name', container_name_type, options_list=['--name', '-n'], help='Name of the container. You can use the backup container list command to get the name of a container.')
c.argument('backup_management_type', backup_management_type)
c.argument('use_secondary_region', arg_type=get_three_state_flag(), help='Use this flag to show container in secondary region. Default: false.')
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be a command behavior switch, not a resource property. It's recommended to use action='store_true' for such cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did the changes. Please review once.

Comment on lines +37 to +41
secondary_region_map = {"eastasia": "southeastasia",
"southeastasia": "eastasia",
"australiaeast": "australiasoutheast",
"australiasoutheast": "australiaeast",
"australiacentral": "australiacentral2",
Copy link
Member

Choose a reason for hiding this comment

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

AKS also has a similar map. It is the same or may be different for different RPs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it seems to be a different map.

@fengzhou-msft fengzhou-msft changed the title [BACKUP] Added CRR functionality for IaaSVM and other CRR commands [BACKUP] Add CRR functionality for IaaSVM and other CRR commands Jan 25, 2021
@fengzhou-msft fengzhou-msft merged commit ca313ac into Azure:dev Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants