After the VM was restored (whole VM not disk), the backup stopped working in Recovery Service Vault. Also the Azure automation account that used to shutdown the VM, stopped working. How to fix it such that all restored VMs continues to work as the previous one?
Kindly note that if you restored a VM to the same resource group with the same name as the originally backed-up VM, backup continues on the VM after restore, else if you restored the VM to a different resource group or you specified a different name for the restored VM, you need to set up backup for the restored VM.
Related
Scenario:
I had the need to move resources from one vault to another, without deleting the backups. This was due to cost, as the vault was created and everything protected in GRS, instead of LRS. I stopped all the backups in the GRS vault, moved everything from resource group (workaround that I found) and then I was able to protect everything in the new Vault. As I moved from resource group, the VM's changed their ID, and now I need to restore a backup that was in the old vault, but the restore fails because it's not able to find the VM.
Is there any way to do it?
A VM running in my Azure subscription was deleted and no longer shows up in the portal. However the NIC and disk are still attached to it, and until I'd disassociated the public IP I could still access the site it was publishing. I want to delete everything in the resource group, but cannot due to this issue.
Get-AzVM returns 'ResourceNotFound', although Get-AzNetworkInterface still shows the ID of the problematic VM. The NIC and disk still reference the missing VM but clicking on that doesn't load anything. Remove-AzVM doesn't have any effect. Attempts to delete the NIC or disk fail because of their attachment to the VM that shouldn't exist.
Has anyone had this issue? Is there a way to get Azure support involved without having a support plan?
I just disabled the backup of my Azure VM and moved it to another subscriptions with all dependencies. Now I want to resume the backup using Powershell command. But I find that there is only some command for enable or disable backup, is there anything to resume a backup ?
If you want to resume ? Just Re-enable vm backup?
Reference: Enable backup for an Azure VM and Back up a virtual machine in Azure with PowerShell
You enable backup for an Azure VM, and specify a backup policy.
The policy defines when backups run, and how long recovery points created by the backups should be retained.
The default protection policy runs a backup once a day for the VM, and retains the created recovery points for 30 days. You can use this default policy to quickly protect your VM.
Enable backup as follows:
First, set the default policy with Get-AzRecoveryServicesBackupProtectionPolicy:
$policy = Get-AzRecoveryServicesBackupProtectionPolicy -Name "DefaultPolicy"
Enable VM backup with Enable-AzRecoveryServicesBackupProtection. Specify the policy, the resource group and the VM name.
Enable-AzRecoveryServicesBackupProtection `
-ResourceGroupName "myResourceGroup" `
-Name "myVM" `
-Policy $policy
As you know there is enable or disable operation for Azure VM backup. I think there is no such resume backup operation. Per my understanding, I suppose what you want is to continue backups the Azure VM in the existing recovery service vault after you move the Azure VM to another subscription. If so, please note that
Recovery Services vault doesn't support cross subscription backups. If
you move a vault with virtual machine backup data across
subscriptions, you must move your virtual machines to the same
subscription, and use the same target resource group to continue
backups.
To move a virtual machine to a new subscription without moving the Recovery Services vault:
Temporarily stop backup
Delete the restore point. This operation deletes only the instant recovery points, not the backed-up data in the vault.
Move the virtual machines to the new subscription
Reprotect it under a new vault in that subscription
In this case, you have to create a new vault for Azure VM backup after you move the VM to another subscription, so you will use Enable-AzRecoveryServicesBackupProtection to enable backup for an Azure VM then start a backup job with Backup-AzRecoveryServicesBackupItem.
Otherwise, you can move a Recovery Services vault and its associated resources to another subscription. Currently, you can move one Recovery Services vault, per region, at a time. You can't move vaults that back up Azure Files, Azure File Sync, or SQL in IaaS virtual machines. To move a Recovery Services vault, you must enroll in a limited public preview.
You also could get more details from the recovery service limitation.
I have an old Azure Recovery Services vault for an on-premise Windows Desktop that I am trying to remove after decommissioning said desktop. Azure is responding with this error message:
Vault cannot be deleted as there are existing resources within the vault. Please ensure there are no backup items, protected servers or backup management servers associated with this vault. Unregister the following containers associated with this vault before proceeding for deletion : VAULT-NAME. Unregister all containers from the vault and then retry to delete vault
Where VAULT-NAME is the name of my vault.
I followed the steps referenced in this answer but could not get past this step due to the fact that there is not a corresponding "Windows" or "WindowsServer" option for the WorkloadType parameter.
$item = Get-AzureRmRecoveryServicesBackupItem -Container $container -WorkloadType AzureSQLDatabase
Skipping the item retrieval and disable steps and instead trying to unregister the container and remove the vault with the following commands was of no use on account of still having backups associated with the container.
Unregister-AzureRmRecoveryServicesBackupContainer -Container $container
Remove-AzureRmRecoveryServicesVault -Vault $vault
I have not mapped this answer to the corresponding Azure commands, but I was able to find my way to a solution via the Azure Portal. The steps were as follows:
Selected my Recovery Service resource
Under the Manage section, clicked Backup Infrastructure
Under Management Servers, clicked Protected Servers
In the list that followed, clicked on the row where my Protected Server Count was greater than 0, in my case, Azure Backup Agent (because the backup agent was installed on my Windows Desktop)
Clicked on my server name in the Protected Server list
Clicked Delete in the card for my protected server
After that completed, I was able to delete the entire vault. These steps may be helpful if you have other Backup Infrastructure resources and possibly even Site Recovery Infrastructure resources associated with a vault.
Update: It seems like there's an open issue for Get-AzureRmRecoveryServicesBackupItem not having any capacity to return MARS backup items which is ultimately what the issue here was.
We have an Azure Service Fabric cluster set up and I'm attempting to use Azure Automation to stop the virtual machine scale set and restart on a schedule. The scale set is assigned to a resource group as follows
My Exteral_Start_ResourceGroupNames and External_Stop_ResourceGroupNames, which the ScheduledStartStop_Parent runbook uses is as follows:
You can see the resource group name matches the resource group name for my VM scaleset. My understanding is that when the runbook fires, all VMs in this resource group, and, therefore, the VM set, should be stopped. However, when the runbook fires, it's not finding any VMs to stop.
Can anyone see what's wrong?
Although they are both VMs, "Virtual Machines" and "Virtual Machine Scalesets" are different resource types in Azure. The underlying nodes of a scaleset are not exposed as 'normal' VMs. You could probably modify your start/stop script to find scalesets in those resource groups instead of normal VMs.
To get you started: The powershell command for finding ScaleSets is Get-AzureRmVmss. That page also details how to shut them down.