Skip to content

Commit

Permalink
Addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vidyadharijami committed Mar 25, 2021
1 parent 55f907e commit 838a284
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ public ASRHyperVReplicaAzureSpecificRPIDetails(HyperVReplicaAzureReplicationDeta
public string RecoveryProximityPlacementGroupId { get; set; }

/// <summary>
/// Gets or sets the SQL Server license type to the machine to in the event of a failover.
/// Gets or sets the SQL Server license type of the machine to in the event of a failover.
/// </summary>
public string SqlServerLicenseType { get; set; }

Expand All @@ -885,7 +885,7 @@ public ASRHyperVReplicaAzureSpecificRPIDetails(HyperVReplicaAzureReplicationDeta

/// <summary>
/// Gets or sets the tags for the target NICs.
/// </summary>
/// </summary>S
public IDictionary<string, string> RecoveryNicTag { get; set; }
}

Expand Down Expand Up @@ -1211,7 +1211,7 @@ public ASRInMageAzureV2SpecificRPIDetails(InMageAzureV2ReplicationDetails detail
public string RecoveryProximityPlacementGroupId { get; set; }

/// <summary>
/// Gets or sets the SQL Server license type to the machine to in the event of a failover.
/// Gets or sets the SQL Server license type of the machine to in the event of a failover.
/// </summary>
public string SqlServerLicenseType { get; set; }

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -513,4 +513,7 @@ Recommended Action: To cleanup the resources created by Test failover run the Te
<data name="IPConfigNotFoundInVMNic" xml:space="preserve">
<value>IP Config "{0}" not found in VM NIC "{1}".</value>
</data>
<data name="DiskTagCannotBeSet" xml:space="preserve">
<value>Disk Tag "{0}" cannot be set if UseManagedDisk is "{1}".</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,11 @@ public override void ExecuteSiteRecoveryCmdlet()

private void VMwareToAzureReplication(EnableProtectionInput input)
{
var seedManagedDiskTag = this.DiskTag;
if (!string.IsNullOrEmpty(this.RecoveryAzureStorageAccountId))
{
seedManagedDiskTag = null;
}
var providerSettings = new InMageAzureV2EnableProtectionInput
{
ProcessServerId = this.ProcessServer.Id,
Expand All @@ -566,7 +571,7 @@ private void VMwareToAzureReplication(EnableProtectionInput input)
SqlServerLicenseType = this.SqlServerLicenseType,
TargetVmTags = this.RecoveryVmTag,
TargetNicTags = this.RecoveryNicTag,
SeedManagedDiskTags = this.DiskTag,
SeedManagedDiskTags = seedManagedDiskTag,
TargetManagedDiskTags = this.DiskTag
};

Expand Down Expand Up @@ -667,9 +672,24 @@ private void EnterpriseAndHyperVToAzure(EnableProtectionInput input)
providerSettings.TargetVmSize = this.Size;
providerSettings.SqlServerLicenseType = this.SqlServerLicenseType;
providerSettings.TargetVmTags = this.RecoveryVmTag;
providerSettings.TargetManagedDiskTags = this.DiskTag;
providerSettings.TargetNicTags = this.RecoveryNicTag;

if(this.DiskTag != null || this.DiskTag.Count > 0)
{
if(this.UseManagedDisk == Constants.False)
{
throw new PSArgumentException(
string.Format(
Resources.DiskTagCannotBeSet,
this.DiskTag,
this.UseManagedDisk));
}
else
{
providerSettings.TargetManagedDiskTags = this.DiskTag;
}
}

if (!string.IsNullOrEmpty(this.RecoveryAzureNetworkId))
{
providerSettings.TargetAzureNetworkId = this.RecoveryAzureNetworkId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,19 @@ public override void ExecuteSiteRecoveryCmdlet()
diskTag = providerSpecificDetails.TargetManagedDiskTags;
}

if(useManagedDisk == Constants.False)
{
if(diskTag != null ||
diskTag.Count > 0)
{
throw new PSArgumentException(
string.Format(
Resources.DiskTagCannotBeSet,
diskTag,
useManagedDisk));
}
}

var deploymentType = Utilities.GetValueFromArmId(
providerSpecificDetails.RecoveryAzureStorageAccount,
ARMResourceTypeConstants.Providers);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Accept wildcard characters: False
```
### -DiskTag
Specify the tags for the disks of the VM.
Specify the tags for the disks of the VM. This is applicable for Vmware to Azure and HyperV to Azure providers.
```yaml
Type: System.Collections.Generic.IDictionary`2[System.String,System.String]
Expand Down Expand Up @@ -458,8 +458,8 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -RecoveryNicTag
Specify the tags for the target NICs of the VM.
### -RecoveryNicTag
Specify the tags for the target NICs of the VM. This is applicable for Vmware to Azure and HyperV to Azure providers.
```yaml
Type: System.Collections.Generic.IDictionary`2[System.String,System.String]
Expand Down Expand Up @@ -519,7 +519,7 @@ Accept wildcard characters: False
```
### -RecoveryVmTag
Specify the tags for target VM.
Specify the tags for target VM. This is applicable for Vmware to Azure and HyperV to Azure providers.
```yaml
Type: System.Collections.Generic.IDictionary`2[System.String,System.String]
Expand Down

0 comments on commit 838a284

Please sign in to comment.