Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Commit 6294943

Browse files
SQL Registration Feature (#403)
1 parent e4da651 commit 6294943

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

azure-migrate/migrate-at-scale-vmware-agentles/Agentless VMware automation/AzMigrate_UpdateMachineProperties.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,21 @@ Function ProcessItemImpl($processor, $csvItem, $reportItem) {
5858
# parameters to pass to New-AzMigrateServerReplication
5959
$params = @{}
6060
$params.Add("InputObject", $ReplicatingServermachine)
61+
62+
$sqlServerLicenseType = $csvItem.SQL_SERVER_LICENSE_TYPE
63+
if ([string]::IsNullOrEmpty($sqlServerLicenseType) -or ($sqlServerLicenseType -eq "NoLicenseType")) {
64+
$processor.Logger.LogTrace("SQL_SERVER_LICENSE_TYPE is not mentioned for: '$($sourceMachineName)', or it is set to 'NoLicenseType'")
65+
$params.Add("SqlServerLicenseType", "NoLicenseType")
66+
}
67+
else {
68+
$allowedLicenseTypes = @("PAYG", "AHUB")
69+
if (-not $allowedLicenseTypes.Contains($sqlServerLicenseType)) {
70+
$processor.Logger.LogError("SQL_SERVER_LICENSE_TYPE is not valid for: '$($sourceMachineName)'")
71+
$reportItem.AdditionalInformation = "SQL_SERVER_LICENSE_TYPE is not valid for: '$($sourceMachineName)'"
72+
return
73+
}
74+
$params.Add("SqlServerLicenseType", $sqlServerLicenseType)
75+
}
6176

6277
#Code added to accommodate for Target Subscription if the replicated machine is suppose to land in a different Target subscription
6378
$targetSubscriptionID = $csvItem.TARGET_SUBSCRIPTION_ID
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
AZMIGRATEPROJECT_SUBSCRIPTION_ID,AZMIGRATEPROJECT_RESOURCE_GROUP_NAME,AZMIGRATEPROJECT_NAME,AZMIGRATE_APPLIANCE_NAME,SOURCE_MACHINE_NAME,AZMIGRATEASSESSMENT_NAME,AZMIGRATEGROUP_NAME,TARGET_SUBSCRIPTION_ID,TARGET_RESOURCE_GROUP_NAME,TARGET_VNET_NAME,TARGET_SUBNET_NAME,TARGET_MACHINE_NAME,TARGET_MACHINE_SIZE,LICENSE_TYPE,OS_DISK_ID,TARGET_DISKTYPE,AVAILABILITYZONE_NUMBER,AVAILABILITYSET_NAME,TURNOFF_SOURCESERVER,TESTMIGRATE_VNET_NAME,UPDATED_TARGET_RESOURCE_GROUP_NAME,UPDATED_TARGET_VNET_NAME,UPDATED_TARGET_MACHINE_NAME,UPDATED_TARGET_MACHINE_SIZE,UPDATED_AVAILABILITYZONE_NUMBER,UPDATED_AVAILABILITYSET_NAME,UPDATED_NIC1_ID,UPDATED_TARGET_NIC1_SELECTIONTYPE,UPDATED_TARGET_NIC1_SUBNET_NAME,UPDATED_TARGET_NIC1_IP,UPDATED_NIC2_ID,UPDATED_TARGET_NIC2_SELECTIONTYPE,UPDATED_TARGET_NIC2_SUBNET_NAME,UPDATED_TARGET_NIC2_IP,OK_TO_UPDATE,OK_TO_MIGRATE,OK_TO_USE_ASSESSMENT,OK_TO_TESTMIGRATE,OK_TO_RETRIEVE_REPLICATIONSTATUS,OK_TO_CLEANUP,OK_TO_TESTMIGRATE_CLEANUP
2-
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,srcrg-ecy,ECYPROJ,sv-app-2,testvm-cvm2,,srcrg-ecy,rg-name,sv-target-ecy-rg,vnet-name,default,testvm-cvm2,,NoLicenseType,,,,,Y,vnet-ecy,,,testvm-sv-2,,,,,,,,,,,,Y,Y,Y,Y,Y,Y,Y
3-
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,srcrg-ecy,ECYPROJ,sv-app-2,testvm-cvm6,,srcrg-ecy,rg-name,sv-target-ecy-rg,vnet-name,default,testvm-cvm6,,NoLicenseType,,,,,Y,vnet-ecy,,,testvm-sv-6,,,,,,,,,,,,Y,Y,Y,Y,Y,Y,Y
1+
AZMIGRATEPROJECT_SUBSCRIPTION_ID,AZMIGRATEPROJECT_RESOURCE_GROUP_NAME,AZMIGRATEPROJECT_NAME,SOURCE_MACHINE_NAME,AZMIGRATEASSESSMENT_NAME,AZMIGRATEGROUP_NAME,SQL_SERVER_LICENSE_TYPE,TARGET_SUBSCRIPTION_ID,TARGET_RESOURCE_GROUP_NAME,TARGET_VNET_NAME,TARGET_SUBNET_NAME,TARGET_MACHINE_NAME,TARGET_MACHINE_SIZE,LICENSE_TYPE,OS_DISK_ID,TARGET_DISKTYPE,AVAILABILITYZONE_NUMBER,AVAILABILITYSET_NAME,TURNOFF_SOURCESERVER,TESTMIGRATE_VNET_NAME,UPDATED_TARGET_RESOURCE_GROUP_NAME,UPDATED_TARGET_VNET_NAME,UPDATED_TARGET_MACHINE_NAME,UPDATED_TARGET_MACHINE_SIZE,UPDATED_AVAILABILITYZONE_NUMBER,UPDATED_AVAILABILITYSET_NAME,UPDATED_NIC1_ID,UPDATED_TARGET_NIC1_SELECTIONTYPE,UPDATED_TARGET_NIC1_SUBNET_NAME,UPDATED_TARGET_NIC1_IP,UPDATED_NIC2_ID,UPDATED_TARGET_NIC2_SELECTIONTYPE,UPDATED_TARGET_NIC2_SUBNET_NAME,UPDATED_TARGET_NIC2_IP,OK_TO_UPDATE,OK_TO_MIGRATE,OK_TO_USE_ASSESSMENT,OK_TO_TESTMIGRATE,OK_TO_RETRIEVE_REPLICATIONSTATUS,OK_TO_CLEANUP,OK_TO_TESTMIGRATE_CLEANUP
2+
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,srcrg-ecy,ECYPROJ,testvm-cvm3,,srcrg-ecy,PAYG,xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,sv-target-ecy-rg,vnet-name,default,testvm-1,,NoLicenseType,,,,,Y,vnet-ecy,,,testvm-sv-1,,,,,,,,,,,,Y,Y,Y,Y,Y,Y,Y

0 commit comments

Comments
 (0)