INTRODUCTION
The network is in good shape now, it has a dedicated subnet for SFTP traffic, locked down by a security group that only lets the right port through. But the Virtual Machine itself is still sitting on the old network, sized for nothing in particular, with no extra storage and no plan for turning itself off. Time to fix all four of those.
This part walks through four small but common VM management tasks: moving the machine onto the new subnet, resizing it for a heavier workload, attaching a dedicated data disk, and scheduling it to shut down automatically at the end of the day. None of these are complicated on their own, but together they turn a generic VM into something purpose-built for the job it's about to do, acting as an FTP server.
What You'll Need
- Access to the Azure portal
- The guided-project-vm VM from Part 1
- The ftpSubnet and ftpNSG you set up in Part 2
Step 1: Move the virtual machine network to the new subnet.
- From the Azure portal home page, in the search box, enter virtual machines.
- Select virtual machines under services.
- Select the guided-project-vm virtual machine.
- If the virtual machine is running, select Stop.
- 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.
- Select Home to return to the Azure portal home page.
- You’ve migrated the VM 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 you to vertically scale the machine to increase the computing power.
Step 2: Vertically scale the virtual machine.
- From the Azure portal home page, in the search box, enter virtual machines.
- Select virtual machines under services.
- 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 tutorial, select something similar.
- Select Resize.
- Select Home to return to the Azure portal home page.
Step 3: Attach data disks to a virtual machine.
- From the Azure portal home page, in the search box, enter virtual machines.
- Select virtual machines under services.
- 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.
- Select Home to return to the Azure portal home page.
Step 4: Configure automatic shutdown on a virtual machine.
- From the Azure portal home page, in the search box, enter virtual machines.
- Select virtual machines under services.
- 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.
Note: If your save button doesn't appear go back to the overview page and start the VM. Now go back to your auto-shutdown configuration the save button will appear after that.
- Select Home to return to the Azure portal home page.
CONCLUSION
Four changes were made, each addressing a different concern: the VM is on the right network, sized appropriately for its workload, equipped with dedicated storage for uploads, and set to stop itself automatically to control costs. None of these tasks required rebuilding anything, just adjusting a running resource to better fit its actual job.
Next in the series, we'll shift from the VM to the storage account, and work through the management tasks that keep it configured and accessible the way it needs to be.
Top comments (0)