From 78cf46aac110c1cb47265667c958a70592299b4a Mon Sep 17 00:00:00 2001 From: hiaga Date: Wed, 16 Sep 2020 17:37:39 +0530 Subject: [PATCH] increasing VM protection limit from 100 to 1000 --- .../azure/cli/command_modules/backup/custom.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/backup/custom.py b/src/azure-cli/azure/cli/command_modules/backup/custom.py index 301b4581305..2b598aecd27 100644 --- a/src/azure-cli/azure/cli/command_modules/backup/custom.py +++ b/src/azure-cli/azure/cli/command_modules/backup/custom.py @@ -207,6 +207,10 @@ def enable_protection_for_vm(cmd, client, resource_group_name, vault_name, vm, p vault = vaults_cf(cmd.cli_ctx).get(resource_group_name, vault_name) policy = show_policy(protection_policies_cf(cmd.cli_ctx), resource_group_name, vault_name, policy_name) + # throw error if policy has more than 1000 protected VMs. + if policy.properties.protected_items_count >= 1000: + raise CLIError("Cannot configure backup for more than 1000 VMs per policy") + if vm.location.lower() != vault.location.lower(): raise CLIError( """ @@ -344,9 +348,9 @@ def update_policy_for_item(cmd, client, resource_group_name, vault_name, item, p Use the relevant get-default policy command and use it to update the policy for the workload. """) - # throw error if policy has more than 100 protected VMs. - if policy.properties.protected_items_count >= 100: - raise CLIError("Cannot configure backup for more than 100 VMs per policy") + # throw error if policy has more than 1000 protected VMs. + if policy.properties.protected_items_count >= 1000: + raise CLIError("Cannot configure backup for more than 1000 VMs per policy") # Get container and item URIs container_uri = _get_protection_container_uri_from_id(item.id)