Scenario
With the network settings updated to support segmenting the Linux virtual machine, you’re ready to manage the virtual machine itself. The first thing the Azure admin asks you to complete is moving the virtual machine to the new subnet you created in the previous exercise.
Note: This is a continuation of the project in the article I posted before this.
Move the virtual machine network to the new subnet
- From the Virtual Machines page, select the guided-project-vm virtual machine.
- If the virtual machine is running, select Stop. Note: To make some configuration changes, such as changing the subnet, the VM will need to be restarted. You can request the change without stopping the VM, but Azure will force a restart before completing the change.
- Wait for the Status field to update and show Stopped (deallocated).
- Within the Networking subsection of the menu, select Network settings.
- Select the Network interface / IP configuration hyperlink for the VM.
- On the IP Configurations page, update the Subnet to ftpSubnet.
- Select Apply.
The VM has been migrated from one subnet to another. Remember, the new subnet had specific network security rules applied to help it function as an FTP server. The next task from the Azure admin relates to the computing power of the VM. The admin would like to vertically scale the machine to increase its computing power.
Vertically scale the virtual machine
- From the Virtual Machine page, select the guided-project-vm virtual machine.
- Locate the Availability + scale submenu and select Size.
- Select a new VM size D2s_v5, for example. (Note: If you don’t see the same size as shown in this exercise, select something similar.)
- Select Resize.
With the VM successfully scaled up to a more robust processor, it can handle the new role it’s being assigned.
However, now the Azure admin realizes that if the VM is going to serve as an FTP server, it needs more storage. The Azure admin needs to attach a new data disk to the VM.
Attach data disks to a virtual machine
- From the Virtual Machine page, select the guided-project-vm virtual machine.
- Locate the settings submenu and select Disks.
- Select Create and attach a new disk.
- Leave LUN as default.
- Enter ftp-data-disk for the Disk name.
- Leave the Storage type as default.
- Enter 20 for the Size.
- Select Apply to create the new storage disk and attach the disk to the machine.
Now the VM has enough storage to handle some uploads.
The final thing the Azure admin is concerned about is the cost of running the computer 24 hours a day. The first thing they’ll do every morning is start up the FTP server. However, they’d like to configure it to automatically shut down every day at 7 PM Coordinated Universal Time (UTC).
Configure automatic shutdown on a virtual machine
- From the Virtual Machines page, select the guided-project-vm virtual machine.
- Under the Operations submenu, select Auto-shutdown.
- In order to let late uploads finish, set the scheduled shutdown to 7:15:00 PM.
- Select Save.
The Azure admin has completed all of the management tasks needed for the virtual machine.
Summary
In this project, we successfully managed virtual machines (VMs) by covering essential operational tasks. We demonstrated how to move a VM to a specific subnet to optimize network segmentation and security. Vertical scaling was applied to adjust the VM’s resources according to workload demands, ensuring optimal performance. Additionally, we attached a data disk to expand storage capacity for applications and data. Finally, configuring auto-shutdown helped enforce cost efficiency by automatically stopping VMs during non-working hours. Collectively, these steps highlight best practices in VM lifecycle management, balancing performance, scalability, and cost control.














Top comments (0)