Microsoft Azure Administrator Associate AZ-104 Topic Manage Azure VM
December 13, 2022
  1. Add Data Disks to a VM

So in this section of the course, we’re going to be talking about Azure virtual machines. To manage them, add new network interfaces and discs, change their sizes, redeploy them, etc. So in this video, let’s talk about data disks.

Now, it might not be obvious, but when you create a virtual machine, you create a machine and what’s called an operating system or a temporary disk. This virtual machine that we created a few lessons ago has an operating system disc of 128 GB, basically. And this is done with storage. So we don’t have to worry about allocating this, et cetera. But 128 GB is for the operating system, and we don’t really have a lot of local storage if we needed it. If you have any workloads on your virtual machine that need to access disk, You’ve got a lot of different options, including the Azure files option we talked about previously or using accounts with other external storage. But if you need storage attached to this machine, the option is called a data disk.

And so you go into the VM under the disc section, and you’re going to want to say “Add data disk.” Right now, we do not have any unused managed discs because we are using managed discs for this. So we’re going to need to create a new managed disk. So we’re going to call Shd “new managed disk.” We’re going to put that into the 102 resource group along with the existing virtual machine. Because it is a managed disk, our location cannot be used because there is no availability concept at the time of the premium SSD. Now the question is, where do we want to manage this from? It could be empty; we could save a snapshot of a VM and restore it. We could take the contents of a spot. So let’s start with an empty disk, and we get to choose the size.

Now, remember the storage. You are charged basically for the size. So this would be 1 TB. So you can see here that it’s giving me because it’s a premium drive with a limit of 5000 operations per second and 200 megabits per second. I’m going to say “create.” Okay, so we’ve got it attached, we haven’t pressed the same button yet, but it’s basically designed to manage discs and say that’s the disc we want, and we can say save. And so once this is updated, our virtual machine will have the operating system disk, which is like the C drive, and a data disc attached that could be like the D drive. And so this virtual machine will have stored files that will be preserved if it gets eliminated and recreated. Now, the other thing that we can do with these discs is detach them, and then we can attach them to another virtual machine. So data discs are actually portable.

Now, you cannot attach a data disc to more than one machine at the same time, but you can attach them and reattach them. Now, I’ll point out that when you created this virtual machine, one of the options you had was how many data discs it had. So you can see that this is a B, one MS virtual machine, and there’s a limit of two data disks. So I knew I had enough discs for two days if I needed them. If you need four or eight, then you are forced to go to a larger virtual machine. This is the same for the D series. Some series, like the E series, seem to contain large numbers of options (816, 32). But as your junior virtual machine instance type, you are also getting a limit on the number of data discs that you can have. So that’s how you add or remove a data disc from a virtual machine.

2. Add NIC Interfaces to a VM

So we just saw how we can add multiple data discs to a virtual machine. We can also play with the networking aspect. Now, in most normal situations, we have a machine that has a single network interface and belongs to a single virtual Network instant.

Let’s look at the example where we want this virtual machine to belong to more than one virtual network and subway combination. In order to do that, we need to add a second network interface to it. Now before I can even do that, I’m going to go up to the resource group level and I’m going to look at the virtual network that we are using. I believe this is the only virtual network; we can see two devices connected to the default subnet. What we’re going to do is add a second subnet just so we can differentiate the two. Right now, we have this network interface space. The subnets, I believe, are the same as you say. So we’re going to need to add a second address range. I’m going to say 1016, 160.

Okay, so now that we’re adding, we’re doubling the size of our virtual network, and then we’re going to want to add a new set that’s called “second.” That is the 1016:160 address. Okay, I’m going to leave everything else to default. And so now we’ve got a virtual network that has twice the address space, and we’ve got two sets of computers on that virtual network. Okay, now our virtual machines are still on the single subnet. Let’s go back to the resource group. We’re going to go to the new Virtual MachineAZ in this case. Now, before we make any changes to the networking, the VM has to be stopped. As a result, your VM is in the process of being stopped before you attempt this. And you would click the stop button here to do that. Go into networking. We still only have one network interface.

We’re going to say attach the network interface. Now we don’t have a network interface to choose from. There’s not an empty, unused network interface. As a result, we’ll make one and call it the Azschd network. We are forced to create this virtual network interface on the same virtual network as the existing net card. So you can’t put your two different cards on different physical virtual networks, but you can change the subnet. So we’ll change this to the second subnet. We’re going to let it be a private IP address. We don’t need an IP address for this one. And we’ll leave all the defaults for the rest and say “Create.” Okay, so just to be clear, we’re going to have a Mermaid app with a Virtual Machine that has two network cards. That means two IP addresses. One is a public address. That is, it is accessible via the public Internet.

The other will be a private IP address that will allow it to connect to any resources in the second subnet that we assign to it. So we’re going to let it choose the network card and say, “Okay,” and it’s going to attempt to attach this second network card to this virtual machine. will let that do that. That was pretty quick. We can see now that there are two tabs here. One for the existing one, and now one for the new one. So I have a private IP address for this. It’s not publicly accessible, and the second network card is connected to the second subnet, while the first network card is connected to the first. Now, we don’t have any network security groups or application security groups yet. I’m not going to continue to create them. However, we can see that we are waiting for a second network card, which we will then use to connect to resources in the second. 

3. Change VM Size

So we’re back looking at the virtual machines. Again. This is a Windows machine. We chose the B1MS instance, which has one virtual CPU and 2GB of memory. Now, as you know, one of the great things about the cloud is that we are able to autoscale, manually scale, and basically change our mind about the size of the virtual machine. If we’re willing to pay more, we go to the third setting, called size. It will bring up the familiar table of sizes. We’ve decided on option B. We can see what the pricing is on that. We can see the CRM features, the number of data points, and so on. So let’s say the B one is really not doing well for us. We could upgrade from the B to the M, and that would give us CPUs, 8 GB of RAM for data disks, more Office per second, etc., etc.

Or we can switch over to bigger hardware. In terms of the D series, Microsoft is now working on the V3 version of the D series. Now we’re getting into costs that, of course, are in the hundreds per month range.So keep that in mind as you’re making these decisions that it’s affecting.

So let’s go crazy and go from one to four. Okay? This is going to be four times the CPU and eight times the memory, etc. So I’m going to say select. Now this is a disruptive operation, right? As a result, the virtual machine had to be terminated. But even if the virtual machine wasn’t stopped, there would be a little bit of downtime as this virtual machine moved over. If you want Ms. to be for Ms., this is not a trivial operation; there will be some server restarts involved. So then, of course, if we change our minds, we can always scale down. 

4. Redeploy a VM

Now, we talked about being able to move virtual machines. previously, but if we go into the resource group here, we can see that there is a Move menu item inside the resource group level, and we can simply choose some of these resources: the VM, the address, the operating system disk, and the network heart. And we could choose to move them into a new resource group using the Move command. So that’s pretty straightforward in terms of the portal. Of course, you can do this with shell and CLI as well. But what happens when you have a virtual machine? I’m just going to go into this one here. What happens when you have a virtual machine that’s just not cooperating? It’s not starting right, or if you are trying to remote desktop into it using RDP, the RDP is not responding, and you’re just convinced something is really broken.

Stopping and starting has not helped this VM; I need to redeploy it. So how do you redeploy virtual machines? I’m going to show you a couple of ways. Let’s go into the cloud shell for this one. And so I click the cloud shell link, and I’m going to make the screen a bit bigger here. Instead of using the CLI, I switch over to PowerShell and say confirm. We’ll use a PowerShell script called Set Azure to accomplish this. So this is an instruction to the Resource Manager virtual machine, and we’re going to say “redeploy.” Redeploy. So that will give it the signal that we want to just terminate the virtual machine, terminate the temporary disk, terminate the IP address, and just start over. We say the resource group name in this case is 102 RG, and we say the VM name in this case is Zoobm 2.

So when I run this command, it will wipe away the virtual machine, the temporary disk, and the IP address and just redeploy it from scratch. So let that run. So the command ran; you see, it took about a minute, and it says it succeeded. So I’m going to close this, and if I refresh it, we should see the redeployed versus virtual machine distinction. Now, this is not the only way to do that redeployment. If you are the point-and-click type, you can go down here into the redeployment of support and troubleshooting and just click the redeploy button as well. So Redeploy Machine will migrate it to a new Azure host, and your VM will be restarted. You’ll lose your temper, etc. So that’s how you redeploy a VM.

Leave a Reply

How It Works

Step 1. Choose Exam
on ExamLabs
Download IT Exams Questions & Answers
Step 2. Open Exam with
Avanset Exam Simulator
Press here to download VCE Exam Simulator that simulates real exam environment
Step 3. Study
& Pass
IT Exams Anywhere, Anytime!