Skip to content

Commit eb302f4

Browse files
committed
Blocking registration of already registered VM from powershell.
1 parent ae655c6 commit eb302f4

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/RegisterAzureRMBackupContainer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ private bool IsDiscoveryNeeded(string vmName, string rgName, out CSMContainerRes
159159
ContainerQueryParameters parameters = new ContainerQueryParameters()
160160
{
161161
ContainerType = ManagedContainerType.IaasVM.ToString(),
162-
FriendlyName = vmName,
162+
FriendlyName = vmName,
163+
Status = AzureBackupContainerRegistrationStatus.NotRegistered.ToString(),
163164
};
164165

165166
//First check if container is discovered or not

src/ResourceManager/AzureBackup/Commands.AzureBackup/Properties/Resources.Designer.cs

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ResourceManager/AzureBackup/Commands.AzureBackup/Properties/Resources.resx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@
122122
1. VM does not exist
123123
2. VM is Azure IaaS v2 VM
124124
3. The VM name or the Service name needs to be case sensitive
125-
125+
4. VM is already Registered with same or other Vault. Please Unregister VM first and then try to register it again.
126+
126127
Please contact Microsoft for further assistant.</value>
127128
</data>
128129
<data name="ResourceNotFoundMessage" xml:space="preserve">

0 commit comments

Comments
 (0)