How to Create an Azure Virtual Machine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so in today's video we're going to be going on quite the journey as we start diving into how to create a virtual machine in microsoft azure this is going to be quite a long one so i'm going to chuck the uh the time stamps up on the screen or down in the description as well so if you want to jump around go for it we're going to be talking about what is a virtual machine then look at virtualization and then we're going to be diving into microsoft azure to create our first virtual machine and then look at some post creation tasks so let's just go ahead let's get this party started so what is a virtual machine and simply put well it's just a digital version of a computer well but what does that really mean so think about it for a moment you're probably on a laptop or a desktop and that's what you're doing your day-to-day work on but when we think about this i have a laptop and if i pop the hood of the laptop we saw what's in it well we have a cpu for example we have ram or memory we then have our disk drive to store all of our cute pictures of our dogs and cats or whatever we've got and then we have our network interface so that allows us to be able to watch youtube like you are now and other such things on the internet so we have a laptop and then we have our physical components that make up that laptop and then we actually need some software to be able to make this hardware do something and that's what we call our operating system and our operating system could be like windows 10 or linux or mac os so on and so forth so now we've got operating system then you start installing all your applications might be microsoft teams word powerpoint computer games or you know right now i'm using obs to record this video whatever it might be so at this point we have one physical laptop but you might need to now have another operating system to test out maybe your company is like ah okay we've got windows down but we want to try out some linux stuff because we think that's going to be able to scale in a different way or maybe we want to try out some new tools that only work on linux whatever it is doesn't really matter well at this point you might be thinking well i have one laptop do i have to go buy another laptop or go find some hardware from something i mean that might be one option if you have it lying around you could just install linux on that new laptop and go from there but maybe you only have the one computer and that's where virtual machines come in now we can create a computer within the computer you may be thinking hang on a minute it kind of sounds like the movie inception it's like a dream within a dream and that's the same kind of gig we can now have our windows 10 laptop and we can host a virtual machine running linux all within the same computer and it's going to get a virtual version of a cpu ram disk and network so this is pretty awesome stuff to think that we now can have multiple operating systems running different applications all from one computer and that's absolutely it that's the basis of a virtual machine so the next question is well how on earth do we go and create these virtual machines and this is where we start diving into the world of virtualization and here we need to start talking about what we call a hypervisor and a hypervisor is almost like an emulator so you might be there one night thinking i'd love to play super mario from the game boy but you don't own a game boy anymore well with an emulator you can make one computer system like your windows 10 device behave like another like a game boy and in this world when we think about hypervisor it's pretty similar i can take my windows 10 device and then with my hypervisor i can start emulating or creating virtual machines for linux different windows operating systems and so on and so forth so with this hypervisor it comes in a couple of flavors so we have our type 1 hypervisor otherwise known as our bare metal hypervisor and then we have our type 2 hypervisor which is called our hosted hypervisor so what are the differences well quickly type one this is how it looks out we have our physical device and from there that could be our laptop or an enterprise world it's probably going to be our server and then instead of installing a traditional operating system like windows 10 or mac then we install our hypervisor and this could be things like hyper-v or vmware esxi and so on and then the hypervisor then allows us to create virtual machines on top of that so again like windows server linux server so on and so forth on top of it so the hypervisor allows the virtual machines to make use of all the physical hardware on that server and then we have our type 2 hypervisor and the way this works is on our host machine what we do is we install a normal operating system so windows 10 for example and now we install the hypervisor as software just like a normal application product so you know just like you install microsoft teams you're going to install the hypervisor and this could be things like vmware workstation or virtualbox and so on and so forth and then once you have that hypervisor you can now go ahead and start creating vms with different operating systems all the same if you need so that's in a nutshell what a hypervisor is and quickly azure under the hood they're using really amazing type 1 hypervisors to get this large-scale computing that we can get from cloud computing so at this point let's dive in and talk a little bit more about virtual machines in microsoft azure so now that we have the ground work done the fundamentals about virtual machines and hypervisors let's talk about microsoft azure so microsoft is your virtual machines are what we call infrastructure as a service so that means you have to manage some pieces and then the cloud provider in this case microsoft azure manages some of the other pieces for you so if you think about on-premises you have to manage everything the physical server the networking the storage the virtualization you've got to do it all and then the operating system the apps patching so on and so forth but then when we move that into infrastructure as service all that kind of compute level so the server the storage the virtualization the networking that's all managed by that cloud provider and then you have to make sure that you just manage the operating system updating that so on and so forth the applications and the data so there's kind of a separation of duties here and that's why when we go into azure we can really use these virtual machines for all sorts of use cases so we could be running enterprise applications like sql sharepoint any other kind of windows server or linux based operating systems and applications but then we can also be using it to develop and create new applications or extending our on-premise data center to the cloud so when we go and create these azure virtual machines it's not just the vm itself we also have other components that go around it so we of course do have the virtual machine which you create again from either a marketplace image like windows or linux or red hat whatever it is or you can upload your own custom image where you've made some tweaks that make sense for your organization but then we have for example disk so we have storage so you're going to have an operating system disk you might add some data disk to store your application data for example and then we're going to have networking so we're going to have your virtual network we're going to add our different subnets which makes sense for your infrastructure we're going to have a network interface card on that virtual machine so we can communicate to other services within azure and then we have our network security group which allows us to allow or deny traffic to this virtual machine and then you can have monitoring for example boot diagnostics so on and so forth and then all these different resources that we're creating we're going to put them in a resource group and a resource group is just a way of logically containing all these different resources that we're building for virtual machines or whatever else you're creating on azure so you don't have to have every component in the same resource group but often we put everything that's on the same lifecycle so for example if i'm going to delete the virtual machine i'm probably going to do a lot of the storage ip addresses and things around it as well so it would logically make sense for us to have it all in the same resource group we're then going to have things like a public ip address so if we want to connect to this virtual machine over a remote desktop we can do that as well so there are quite a few different components that make up a virtual machine but the best way of us seeing this is diving into azure and just taking a look so let's get started okay so before you get started i recommend making sure that you have an azure account so you can follow along you can easily do this just bing or google azure free account you can see here we've got websites like azure.microsoft.com account free if you load that up you then get to a page which allows you to start free on creating your azure account today so if you do that you get 12 months of free services you can see all the information here from the us that that equates to so at this point now let's go ahead and create the virtual machine there's multiple ways that you can get to virtual machines and start creating that we're here in the portal.azure.com portal and you can see here i can either go to azure services virtual machine i can do create a resource choose compute virtual machine so on so forth i'm just going to go to the top here choose my virtual machines and at this point we now brought into the virtual machine landing page and i don't have any virtual machines so nothing is being displayed to me because you know we're creating our first virtual machine right now so at this point let's just go ahead and do add and then we're going to do virtual machine this is now going to bring us for a nice easy wizard to get us started and you can see here that toss the top we've got the different sections we're going to look at from this networking management so on and so forth and at the bottom here as we go down it's going to ask us all the different questions about what our virtual machine configuration is going to look like so first up subscription i only have one which is my visual studio enterprise and in your world just select whatever subscription you're trying to build this virtual machine in now we get to resource group so i'm just going to do create new because i'm going to create this to hold all of the different resources for my vm so i'm going to do rg for resource group dash vm first for reversed vm vm01 and there's plenty of great documentation around different naming conventions i'll put a link in the description just so you can get used to this as well next up we need to get the virtual machine and name so i'm going to call it vmfirst01 and now you need to choose your region so it's worth saying that when you're choosing a region you probably want to choose one which is closest either to you developing your services or working on this virtual machine or if it's an application closest to your end users in my case i'm in the us so i'm going to create this in us west too and then we have availability options right now i have no infrastructure redundancy we're just building one vm so you know we don't really care about availability zones and separating our resources across azure regions or availability sets for distributing our vms across fold domains we're not going to worry about any of that we're going to leave that as default and now we get to the point of image and we mentioned this earlier you can either have a marketplace image which we're seeing here which is you know it's ubuntu server or you can upload your custom images and we're not going to talk about custom images in detail today we're just going to create a marketplace virtual machine so i'm just going to drop this down you can see here there's some pretty common ones to get started with red hat windows server so on and so forth so in our world we're just going to choose windows server 2019 data center gen 1. and now that we've done that we now want to choose the size for this virtual machine so you can already see here it's kind of giving us a default that was there already so the standard d2s machine but what i'm going to do is i can either click down to this and it's going to then give us the recommended by image publisher so you know you might want to run it on 3.5 gig with one vcpu so on and so forth or if you know none of them really fit the bill for you you can do see all sizes and then from here we can select all different sizes of virtual machines we can see at the top here kind of the most used by azure users but then it gives you all a synopsis of the different series so you know what does the d series mean b series a so on so forth and you can see what are the vcpus what's the ram the data disks the max iops and then what the you know estimated monthly cost is going to be so for example i might say you know what i want a d4 s v3 because it gives me more iops and that's going to cost me 104. or if i think that's a little bit expensive yeah i'm just going to go ahead and go back to this d2s v3 i can choose that and then just hit select at this point we now need to set up our administrator account so the administrator account is what's the admin the local admin account going to be for this windows server so i'm just going to give it a username and a password and then we'll pick up from there okay so we now have our administrator account set up we're going to be using an admin user it's just my username and then you know i set up a super strong password for this demo and now we get to inbound port rules so at this point we can select whether or not any ports can be allowed from the public internet so for example if i didn't want any i could just change public inbound ports to none and that's going to turn that off or i can do allow selected ports drop down the select inbound ports and choose from some very common ports here so you know if i wanted to be just over the internet i could do port 80 but if i want to do remote desktop services so rdp i can choose free free eight nine what this is now going to do is start setting up this networking for us to allow us to remote connect to this device obviously in production you're probably not going to want to do this for your virtual machines and use something else to connect maybe something like azure bastion but we'll talk about that another day so just for this lab and again wouldn't recommend this for most places in production we're going to leave rdp open and at the bottom here now you can just choose whether or not you have licensing on-prem to help you with your you know reducing the cost here for azure hybrid benefits you know i could say yes i have that and then confirm for example that's going to be based on your own licensing so you're going to have to make your own judgment call there now i'm going to go ahead and hit next and now we come on to disks so from this there's a couple of things to note firstly you always get an operating system disk which in this case is going to be our windows server 2019 and then we get a temporary disk as well which is just for short-term storage but then just like on-premises you didn't just have your operating system disk and install all your apps and put all your data on that you then create data disks for like for a sql database or for your application files and so on and so forth and the same thing applies here in azure as well we can do that so first up we got our os disk type and this allows us to select from hdds to ssds and this is going to change your iops your throughput just the performance of that operating system disk so if it's an important workload you probably want to go for the premium disk and then we have our encryption types we're not going to go through that in deep detail here we're just going to leave that as default and on the bottom here we can now see that you could add data disk to your virtual machine so i can create and attach new disks straight from here but we're going to do this a little bit later on so we're going to leave that for now and move on to networking so from networking here's where you really can start defining your network connectivity for your virtual machine but the awesome thing about microsoft azure is it starts creating a lot of this for you so when you create a virtual machine you can see it starts creating a network interface with a virtual network here we have a subnet a public ip that's being created and of course you could leave this default and just go next next next but if you need to make some configuration changes like add it to an existing virtual network you could drop this down and do that or maybe you have a different ip scheme that you want to go for so if you did create new you can change the address ranges here from from 10.0.0.0 to something different or change the subnet name to something different as well you know for example on this uh actual virtual network i might want this to actually just be v-net vm first one because that makes more logical sense and then just hit okay and we can now see let's change to here the name for our virtual network all right so at this point let's just keep going down so we have our public ip if you hit create new you can change it between whether it's static or dynamic we're going to leave it as default and then we have our nik security group so our network security group here which we're going to leave is basic and this is what allows us to start controlling these inbound ports so we're going to leave this again with rdp enabled and we're not going to use any form of load balancer so let's just go ahead now and hit next and now for management we can start adding things like monitoring for our boot diagnostics so on and so forth we also have cool things in here like auto shutdown which is enabled by default so if you don't want that of course you can turn it off and then backup site recovery so on and so forth we're just going to leave this as default and move on to advanced and then from advanced you can start adding things like scripts extension so on and so forth but again for our first virtual machine we're just going to move on and go to tags and i'm going to leave tags as default as well but in production you're going to want to work with your team and see what tags make sense like you might want to tag a cost center for example so you can easily see in billing how much a department may be costing in azure but again we're going to leave it as default and then we're going to go to review and create and at this point it's just going to validate everything that i've selected to make sure we can even build this virtual machine you can go down obviously see the price again you can go look at all the things that you've selected and then when you're ready when you're happy with this you can just go ahead and hit create now this is going to take a moment so we're going to allow it to build and once this is completely finished here once it's you know we've moved from deployment as in process to completed we'll pick up from there boom so at this point we now have our first azure virtual machine creator windows 2019 server is up and running so you can see a bunch of stuff about your deployment if you want to but what we're going to do is just choose our resource group and then from here we're going to see all the things that come together to create this virtual machine so we have the virtual machine itself we have a virtual network we have that public ip address so we can connect over rdp or port 80 if it was a website for example we've got our network security group so we can build rules to allow or deny traffic and we have our network interface so our vm can connect to things and we have our disk here for our operating system so at this point we have everything created so let's dive in and have a look at our virtual machine and at this point we can see boom our status is running so our vm is up it's running we've got a public ip address assigned what we can see over here and there's a bunch of things we can now do one we can connect which we will in a minute in the left hand side you can see all the settings for your virtual machine you can look at the networking the disk security extensions a lot of these we saw when we were building the virtual machine but now we can get into the nitty gritty of setting this up so at this point let's just go ahead and connect to our new virtual server so i'm going to hit connect and as we can see here we've got rdp ssh and bastion because windows we're just going to choose rdp and at this point here it's going to say we're going to connect your public ip address on this port let's just now go ahead and download that rdp file so there we go it's downloaded an rdp for vm first one let's open that up and now at this point we're going to select connect and now we need to add in that admin that we created earlier so i'm just going to go ahead and put in the username and password and then hit ok and then for the certificate we're going to hit yes and there we go we've connected to our windows server and it looks and feels just like it would if we're on premises we can see server managers already loaded we can hit local server and see all the information about it so you know it's a computer name is vm version one it's in a work group all the different bits and pieces that come together we can also easily see if i bring up explorer here and we go to this pc right now we just have that windows drive where windows server 2019 is installed and that temporary storage which here we really don't put anything because you know files can be removed from this location so this is awesome at this point we have a fully functioning windows server that we can start adding roles and features too or whatever else we might want to do so let's dive back to azure and just look at doing a few little bits of management let's actually go add a new disk so i'm going to just minimize this out and then from azure what we're going to do here on the left hand side under our vm first 01 is we're just going to go down to disks and then from here again we can see we've got our primary disk here for our operating system but if we want to add a new one i can just go ahead at the bottom to create and attach a new disk so i'm going to hit create because i don't have one right now we can give the disk a name so i could just call it data and then we can choose your size you know what's going to be the storage type same things that we've seen earlier i'm just going to choose 4 gig it's just a demo it doesn't really matter too much and then when i'm happy with that i can just go ahead and hit save and now at this point we have our os disk again and now we have a new data disk assigned to our virtual machine so let's jump back to the virtual machine now and see how we actually get that set up within the operating system okay so now we're back on the virtual machine let's just load up explorer again again we can only see the two disks our c drive and our d drive so from server manager if we went to file and storage and then we went to disks well now we can see the three different disks and we got this bottom one here which is the four gig that we just provisioned let's go ahead and get this thing online so to be able to do that we can just do right click and then we can do new volume and at this point we hit next yes this is what we want we want our four gig disks let's just hit next again now it's just going to tell us that this is going to be initialized so okay and next again at this point you could change your drive letter if you want which can hit next the volume name you know i could just change this to data for example hit next again and then create and now at this point we have our data disk that should be able to be seen in windows explorer so if we bring that up boom look at that we now have our f drive for data we could now go and store something in here put our disk drive data whatever it is we can do that so that's just some basic management in our virtual machine and how to add data disks so the next thing i want to show is just a little bit about networking so earlier on when we created our vm we left rdp open so that we could connect to our virtual machine well let's go have a look at how that was actually set up so on the left hand side let's select networking and now we can see all the network configurations for this vm and we can see that the inbound port rules so for rdp 3389 that's connected to this network security group so if we wanted to we could just go to this network security group and manage it this way around so we can see here here all of the different rules that we're allowing so for example i may not want rdp anymore i've done all my testing the vm's working great but i don't want people just to be able to connect to it well i can actually go to the rule that we already had for rdp i could select that and there's multiple different things i could do so one is i could just deny it and now instead of it being allowed for people to connect over rdp we're just going to stop that or if i do allow it we could change it to be a little bit more scoped down so for example source i could change that to maybe an ip address and add in my host computer here my windows 10 laptop we add the public ip address to that so only this laptop connects to this virtual machine so there's multiple different things you can do here we're just gonna hit deny this example and then hit save and there we have it this rule has been updated we can now see that we're denying any of these connections via rdp so the last thing i just want to mention is saving some money on your virtual machines by turning them off so because it's cloud computing you are paying for the compute resources when they're being used and if we just go back to our virtual machine so i'm just going to go back to home here and then select our vm first one and right now it's running and you might think like you did kind of on-premise you just went ahead and just stopped the virtual machine from the operating system and then the resources weren't really being used well in microsoft azure you're still going to be charged for your vm if you do that way so to properly turn this off you want to go back to your virtual machine and at the top here you just want to select stop and then it's going to say do you want to reserve the public ip address we don't care so i'm just going to go ahead and hit ok and now it's going to properly stop our virtual machine of course you're still going to have to pay for a few things like there's still going to be storage that's allocated that you're paying for there's still going to be a public ip and so on and so forth so there are a few things you'll still have to pay for but if you want to save cost on the compute you just need to make sure you stop it properly and you'll know when it's stopped properly because it's going to say status stopped deallocated that's what you're looking for now the computer is deallocated you're not going to be paying for it so we've gone on quite the journey today we've talked about what is virtual machines we've talked about hypervisors virtualization we've created our first virtual machine in the cloud this is pretty awesome so hopefully you've enjoyed this video if you have make sure you subscribe and we'll see you next week for another video
Info
Channel: Harry Lowton
Views: 9,535
Rating: undefined out of 5
Keywords: How to create an Azure virtual machine, azure virtual machine, azure virtual machine tutorial, azure virtual machine creation step by step, how to create virtual machine in azure, how to create virtual machine in azure step by step, creating virtual machine in azure, creating virtual machine in azure step by step, microsoft azure virtual machine, microsoft azure virtual machine setup, azure training, azure tutorial for beginners, virtual machine, az-900, Azure fundamentals
Id: 1GwTtvxNMbA
Channel Id: undefined
Length: 29min 53sec (1793 seconds)
Published: Fri Apr 16 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.