VM management and maintenance #
Use case #
There will be a large amount of virtual machines moved to your Azure tenant. These machines have been used for different test purposes. Your task is to establish proper maintenance and patching procedures. The test VMs must be shut down during non business hours.
Create a test VM #
Create a small linux VM that will be used for this exercise. Create it with Az CLI commands.
OS patching #
Ensure that the Linux VM gets OS patches during third week every month. Decide on the day of the maintenance window. Reserve 2 hours for the maintenance window. You might need to combine this exercise with the following Cost saving functionality. It is a good practice to patch the VMs outside of business hours.
Cost saving #
Configure the MS start/stop v2 to shutdown the VMs during non business hours (Start/stop v2). You will need to assign RBAC permission for the function app. Use least privilege approach. Virtual machine contributor on the subscription level can be used. It has been tested before.
VM image backup #
Ensure that the VM has backup. Configure a recovery service vault with VM image backup.You can choose a default backup policy. Check in the “backup jobs” that everything is working according to the backup schedules.