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

[Site-Recovery] GA Release #5349

Merged
merged 105 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
9f72bbf
init site-recovery
calvinhzy Aug 1, 2022
4781651
actual init with all commands
calvinhzy Sep 14, 2022
5df2058
shorten args
calvinhzy Sep 14, 2022
0cb8b44
shorten args
calvinhzy Sep 15, 2022
7f82c65
merge
calvinhzy Sep 15, 2022
f78c1b7
shorten
calvinhzy Sep 15, 2022
de67857
use latest aaz version
calvinhzy Nov 22, 2022
93cfa6e
test up to alert-setting
calvinhzy Nov 22, 2022
cbd43be
fix some comments
calvinhzy Nov 24, 2022
b0262fb
fix delete and add some more tests(not fully working)
calvinhzy Nov 25, 2022
1079ae8
vault policy tests
calvinhzy Nov 28, 2022
d8820e2
rerun
calvinhzy Nov 28, 2022
f1c4197
move fabric command group to top level
calvinhzy Nov 28, 2022
ea7795e
change name
calvinhzy Nov 28, 2022
50a0658
stuck on fabric
calvinhzy Nov 29, 2022
e57ea1e
rerun test
calvinhzy Dec 22, 2022
b85a41b
add examples
calvinhzy Dec 22, 2022
308d5f9
restructure commands
calvinhzy Dec 23, 2022
5ad83e9
rename --resource-name to --vault-name
calvinhzy Dec 23, 2022
0a44cc8
move protection-container-mapping to top level
calvinhzy Dec 23, 2022
f3a277b
fix delete protection-container-mapping
calvinhzy Dec 23, 2022
f164c50
add more testing, not fully working
calvinhzy Jan 4, 2023
a08f058
move protected-item to top level
calvinhzy Jan 4, 2023
2d891b3
change a2-a to a2a
calvinhzy Jan 5, 2023
29c3570
fix delete network mapping
calvinhzy Jan 5, 2023
55fa2aa
a2-a to a2a
calvinhzy Jan 6, 2023
31fbece
a2-a to a2a
calvinhzy Jan 6, 2023
5d5b751
tested up to commit unplanned failover
calvinhzy Jan 9, 2023
ebac308
remove protection container fix
calvinhzy Jan 12, 2023
24dc2e0
move network-mapping to under fabric instead of network
calvinhzy Jan 12, 2023
aa5cda0
change protection-container-mapping to fabric protection-container ma…
calvinhzy Jan 12, 2023
6f59696
works up to recovery-plan a2a
calvinhzy Jan 12, 2023
c2afc6a
fix delete recoveryplan
calvinhzy Jan 16, 2023
5569af7
finish A2A testing
calvinhzy Jan 17, 2023
c3b77ce
added partial testing
calvinhzy Jan 20, 2023
01e0a1a
add HyperVSite to create fabric type
calvinhzy Jan 31, 2023
4068a22
add HyperVSite to create container mapping type
calvinhzy Feb 3, 2023
de6604e
container mapping works
calvinhzy Feb 6, 2023
ac9ef35
use hard coded values
calvinhzy Feb 7, 2023
abbcc00
enable protection works
calvinhzy Feb 20, 2023
ce5e325
use aaz-dev-tool 0.20.0
calvinhzy Feb 28, 2023
29e63a2
add some more examples
calvinhzy Mar 3, 2023
7d22c8c
add some more examples
calvinhzy Mar 3, 2023
4a764d0
failback still fails
calvinhzy Mar 8, 2023
4869453
remove untested commands
calvinhzy Apr 5, 2023
6bbb89b
rerun tests
calvinhzy Apr 5, 2023
9f18faa
add more examples
calvinhzy Apr 7, 2023
1e8bfb2
add more examples
calvinhzy Apr 7, 2023
f974298
add back commands
calvinhzy Apr 7, 2023
ea48d85
add back commands
calvinhzy Apr 7, 2023
3c5946e
remove commands
calvinhzy Apr 7, 2023
8b21429
add fabric remove
calvinhzy Apr 7, 2023
4c7fb9a
add test with a2a self created resources
calvinhzy Apr 7, 2023
289d71f
Merge remote-tracking branch 'upstream/main' into site-recovery-a2a
calvinhzy Apr 7, 2023
06ac7dd
remove some unfinished tests
calvinhzy Apr 7, 2023
b6f7f0c
make test record only
calvinhzy Apr 7, 2023
16ec88f
make test record only
calvinhzy Apr 7, 2023
0eca42a
service_name
calvinhzy Apr 7, 2023
58056b8
add readme instructions
calvinhzy Apr 7, 2023
1169df8
add examples
calvinhzy Apr 7, 2023
1308c81
record only
calvinhzy Apr 7, 2023
afdcce2
record only recording
calvinhzy Apr 7, 2023
7bc3ff2
remove partially complete tests
calvinhzy Apr 7, 2023
e7ab14d
remove {} in examples
calvinhzy Apr 8, 2023
b0152ea
recording
calvinhzy Apr 8, 2023
b97e977
live test takes 2 hrs so record only
calvinhzy Apr 8, 2023
c0b784d
add back tests for full release
calvinhzy May 19, 2023
6267333
regen with list pagination
calvinhzy Jul 25, 2023
f2cebaf
add back protectable-item list/show
calvinhzy Jul 26, 2023
b1db916
partial testing
calvinhzy Jul 27, 2023
b90084d
add vmmtoazure for network mapping create
calvinhzy Aug 2, 2023
830978d
move protectable-item to top level
calvinhzy Aug 2, 2023
5547bf4
move network-mapping to top level
calvinhzy Aug 2, 2023
80415aa
move protection-container to top level
calvinhzy Aug 2, 2023
9c0679d
move policy to top level
calvinhzy Aug 2, 2023
fbe5079
move alert-setting to top level
calvinhzy Aug 2, 2023
e2b7d33
update readme based on cmd renames
calvinhzy Aug 2, 2023
b076e38
move event/job/recovery-plan to top level
calvinhzy Aug 2, 2023
dd5f0f6
add logical-network and network, move network-mapping to network mapping
calvinhzy Aug 3, 2023
66035f4
test before enable protection done
calvinhzy Aug 4, 2023
7d17f73
merge main
calvinhzy Aug 7, 2023
41f4fde
test b2a up to enable protection
calvinhzy Aug 8, 2023
1e84362
add `protected-item planned-failover`, not working yet
calvinhzy Aug 9, 2023
f738f57
fix some param names
calvinhzy Aug 10, 2023
4c0f3d6
testing H2A B2A case done
calvinhzy Aug 11, 2023
6ab2c52
add h2a b2a examples
calvinhzy Aug 11, 2023
6a230ce
updated e2a test(not passed yet), deleted b2a service generated test …
calvinhzy Aug 15, 2023
54d0f91
E2A test passed
calvinhzy Aug 18, 2023
8f4b2d8
container mapping for v2arcm
calvinhzy Aug 21, 2023
6924818
add some examples
calvinhzy Aug 21, 2023
720c025
add recovery-services-provider list in fabric
calvinhzy Aug 22, 2023
3f66715
add vmware-site machine list
calvinhzy Aug 23, 2023
6b98423
add vmware-site run-as-account list
calvinhzy Aug 23, 2023
0d47430
add to arg options list
calvinhzy Aug 23, 2023
b230df5
add protected-item reprotect
calvinhzy Aug 24, 2023
396254f
tested up to reprotect for v2arcm case
calvinhzy Aug 25, 2023
466377c
v2arcm case recorded
calvinhzy Aug 27, 2023
6eb2a9f
need to fix test for recording
calvinhzy Aug 27, 2023
fbeffa8
record only
calvinhzy Aug 27, 2023
bbf03e3
add example for v2arcm case
calvinhzy Aug 28, 2023
b201d26
remove v2a cs cases as will be deprecated in the future hide v2a clas…
calvinhzy Aug 28, 2023
9ee6369
rerun test
calvinhzy Aug 29, 2023
56f2d1f
update version info
calvinhzy Aug 29, 2023
1d390dc
record only
calvinhzy Aug 29, 2023
73b9ee5
param help
calvinhzy Aug 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,5 @@
/src/command-change/ @allyw

/src/graphservices/ @amatukmolina

/src/site-recovery/ @calvinhzy
5 changes: 5 additions & 0 deletions src/service_name.json
Original file line number Diff line number Diff line change
Expand Up @@ -763,5 +763,10 @@
"Command": "az graph-services",
"AzureServiceName": "Graph Services",
"URL": "https://learn.microsoft.com/en-us/rest/api/graphservices/"
},
{
"Command": "az site-recovery",
"AzureServiceName": "Azure Site Recovery",
"URL": "https://learn.microsoft.com/en-us/azure/site-recovery/"
}
]
8 changes: 8 additions & 0 deletions src/site-recovery/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:

Release History
===============

1.0.0
++++++
* Initial release with swagger api-version 2022-08-01
60 changes: 60 additions & 0 deletions src/site-recovery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Azure CLI SiteRecovery Extension #
This is an extension to Azure CLI to manage SiteRecovery resources.

## How to use ##
### Create a VM as the target
`az vm create -n vm_name -g vm_rg --image Win2012Datacenter --public-ip-sku Standard --admin-password password`

### Create a SiteRecovery Vault
`az backup vault create -g rg -n vault_name -l recovery_loc`

### Create fabrics for the target and recovery region
`az site-recovery fabric create -n fabric_source_name -g rg --vault-name vault_name
--custom-details '{azure:{location:source_loc}}'`

`az site-recovery fabric create -n fabric_recovery_name -g rg --vault-name vault_name
--custom-details '{azure:{location:recovery_loc}}'`

### Create a policy
`az site-recovery policy create -g rg --vault-name vault_name -n policy_name
--provider-specific-input '{a2a:{multi-vm-sync-status:Enable}}'`

### Create protection containers
`az site-recovery protection-container create -g rg --fabric-name fabric_source_name
-n container_source_name --vault-name vault_name --provider-input '[{instance-type:A2A}]'`

`az site-recovery protection-container create -g rg --fabric-name fabric_recovery_name
-n container_recovery_name --vault-name vault_name --provider-input '[{instance-type:A2A}]'`

### Create container mappings
`az site-recovery protection-container mapping create -g rg --fabric-name fabric_source_name
-n container_mapping_source_name --protection-container container_source_name --vault-name vault_name
--policy-id policy_id --provider-input '{a2a:{agent-auto-update-status:Disabled}}' --target-container container_recovery_id`

`az site-recovery protection-container mapping create -g rg --fabric-name fabric_recovery_name
-n container_mapping_recovery_name --protection-container container_recovery_name --vault-name vault_name
--policy-id policy_id --provider-input '{a2a:{agent-auto-update-status:Disabled}}' --target-container container_source_id`

### Create network mappings
`az site-recovery network-mapping create -g rg --fabric-name fabric_source_name
-n network_mapping_src_to_recovery_name --network-name azureNetwork --vault-name vault_name
--recovery-network-id vnet_recovery_id --fabric-details '{azure-to-azure:{primary-network-id:vnetvm_id}}'
--recovery-fabric-name fabric_recovery_name`

`az site-recovery network-mapping create -g rg --fabric-name fabric_recovery_name
-n network_mapping_recovery_to_src_name --network-name azureNetwork --vault-name vault_name
--recovery-network-id vnetvm_id --fabric-details '{azure-to-azure:{primary-network-id:vnet_recovery_id}}'
--recovery-fabric-name fabric_source_name`

### Enable protection
`az site-recovery protected-item create -g rg --fabric-name fabric_source_name -n protected_item_name
--protection-container container_source_name --vault-name vault_name --policy-id policy_id
--provider-details '{a2a:{fabric-object-id:vm_id,vm-managed-disks:[{disk-id:os_disk,
primary-staging-azure-storage-account-id:sa_src_id,recovery-resource-group-id:rg_id}],
recovery-azure-network-id:vnet_recovery_id,recovery-container-id:container_recovery_id,
recovery-resource-group-id:rg_id,recovery-subnet-name:vnet_recovery_subnet}}'`

### Failover
`az site-recovery protected-item unplanned-failover --fabric-name fabric_source_name
--protection-container container_source_name -n protected_item_name -g rg --vault-name vault_name
--failover-direction PrimaryToRecovery --provider-details '{a2a:{}}' --source-site-operations NotRequired`
42 changes: 42 additions & 0 deletions src/site-recovery/azext_site_recovery/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
from azext_site_recovery._help import helps # pylint: disable=unused-import


class SiteRecoveryCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
custom_command_type = CliCommandType(
operations_tmpl='azext_site_recovery.custom#{}')
super().__init__(cli_ctx=cli_ctx,
custom_command_type=custom_command_type)

def load_command_table(self, args):
from azext_site_recovery.commands import load_command_table
from azure.cli.core.aaz import load_aaz_command_table
try:
from . import aaz
except ImportError:
aaz = None
if aaz:
load_aaz_command_table(
loader=self,
aaz_pkg_name=aaz.__name__,
args=args
)
load_command_table(self, args)
return self.command_table

def load_arguments(self, command):
from azext_site_recovery._params import load_arguments
load_arguments(self, command)


COMMAND_LOADER_CLS = SiteRecoveryCommandsLoader
11 changes: 11 additions & 0 deletions src/site-recovery/azext_site_recovery/_help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: disable=line-too-long
# pylint: disable=too-many-lines

from knack.help_files import helps # pylint: disable=unused-import
13 changes: 13 additions & 0 deletions src/site-recovery/azext_site_recovery/_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: disable=too-many-lines
# pylint: disable=too-many-statements


def load_arguments(self, _): # pylint: disable=unused-argument
pass
6 changes: 6 additions & 0 deletions src/site-recovery/azext_site_recovery/aaz/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from azure.cli.core.aaz import *


@register_command_group(
"site-recovery",
)
class __CMDGroup(AAZCommandGroup):
"""Manage Site Recovery Service
"""
pass


__all__ = ["__CMDGroup"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from .__cmd_group import *
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from azure.cli.core.aaz import *


@register_command_group(
"site-recovery alert-setting",
)
class __CMDGroup(AAZCommandGroup):
"""Manage Alert Setting
"""
pass


__all__ = ["__CMDGroup"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from .__cmd_group import *
from ._create import *
from ._list import *
from ._show import *
from ._update import *
Loading