Deploying Ubuntu Instances with MAAS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today's video is proudly sponsored by lenode the note has been doing cloud computing since 2003 which is actually before amazon web services was even a thing on the notes platform you can get your server up and running in minutes and they include all the popular distributions such as debian fedora ubuntu and get this even arch linux and let's be honest what could be better than a linux focus cloud server provider that lets you tell all of your friends i run arch the note has multiple server plans available to make any app scalable and flexible you could use it to host a blog a vpn server a minecraft server and much more in fact lenode is the platform of choice to host the entire web presence of learnlinux tv in addition the note offers 24x7 365 support regardless of plan size so you can get help from a live person when you need it new users can get started right now with one hundred dollars towards your new account and i highly recommend you check them out because lenode is awesome and now let's get started with today's video [Music] hello again everyone and welcome back to learn linux tv in today's video we're going to be checking out mass metal as a service mass is a very awesome utility that you can run on your network and it makes it really simple to provision machines like workstations servers and things like that because you can pixie boot those instances right to mass and then you can deploy ubuntu to those instances directly it's really awesome so what i'm going to do is give you a few notes about how this particular video is laid out and then from there i'll show you the entire installation process and we'll even deploy ubuntu to an instance so let's go ahead and get started mass is awesome i can't wait to get started but before we do there's a few notes that i'd like to go over basically to let you guys know how this particular video is going to be structured but first of all what exactly is mass anyway as you may or may not already know mass stands for metal as a service and mass makes it very easy to deploy ubuntu instances in addition to ubuntu you can also deploy centos and windows as well but those operating systems are beyond the scope of this particular video mass also supports pixie booting as well which is great and i'll actually show you the process of pixie booting a machine later in this video so you'll get a chance to see what that looks like in this video i'm actually going to use a notebook as the example computer that's going to be provisioned by mass but mass is able to do more than just provision physical machines for example you can also use mass to deploy virtual machines openstack and much more we're not going to go over those concepts in this video but you will see the process of provisioning a notebook and that's going to be pretty cool also mass features an easy to use web ui and you'll see that web ui later in this video and in this video i'm going to show you the process of creating a vlan because the style that i'm going to show you is going to have mass in a segregated vlan away from the rest of the network and i'll show you the process of setting up a vlan at least on my hardware also in this video i'm going to show you the installation process for mass we're going to set up our very own server and after i set that up i'm going to pixie boot a notebook so you can see what that process looks like and then i'm going to have mass wipe the notebook and install ubuntu now if you're using a physical server the process is going to be the same i had a notebook lying around the office i figured why not so i decided to use that but if you're not planning on deploying notebooks with mass you can just basically think of the notebook as a server it's pretty much the same difference and here's some additional notes about the layout for this video for the method that i'll be using you'll need network hardware that supports vlans in my case i'll show you the process of setting up pfsense and unify for the purposes of mass so basically i'll create a vlan in pfsense i'll also set up that vlan in unify and that's going to be the vlan that mass will be using now if you use different hardware the process for setting up vlans is going to be different on your end there's countless switches and pieces of hardware out there there's no way that i can show you the process on every piece of hardware so if you're using equipment that's different than mine then in that case you'll have to use the documentation that came with your hardware and translate what i'm doing to how you do that on your hardware i'd love to show you the process for every single piece of hardware out there but honestly that's impossible and here's a quick diagram that shows you how i plan on setting up mass on my network so obviously we have the internet right here so that could be your cable modem or something like that and again i use pfsense as my firewall router so i'm going to be setting up vlan 900 over here on pfsense and that vlan will be used specifically for pixie booting and then here i have a unifi switch so what i'm going to do is configure a port to use vlan 900 and that's the port that this mass server will be plugged into and then using the mass server i'll be setting up a laptop now the reason why i'm going to be doing it this way is because on my network pfsense is actually responsible for dhcp whenever something in my rack requests an ip address it's going to actually get an ip address from pfsense so all the servers here are going to talk to pfsense to get an ip address now a lot of people will probably want to know why are you using dhcp for servers and not a static ip well actually everything here uses a static lease aka dhcp reservations and that's what i prefer so pf sense has a list of all of my servers and knows what ip address they're supposed to have since i configure these with static leases the ip addresses never change so anytime one of these servers boots up it's going to go through the switch to pf pfsense it's going to get an ip address and then pf sends replies and gives the server an ip address now in this case i really don't want this particular vlan vlan 900 to have dhcp from pfsense i want anything that i plug into the mass server to boot via pixie booting so for this particular vlan what i'm going to do is disable dhcp so here in pf sense i'm basically not going to configure a dhcp server for vlan 900 as a consequence of that i do have to set up a static ip for the mass server and mass itself will issue an ip address to anything that connects to that vlan so that means the mass server will be responsible for dhcp on that vlan now technically this laptop is actually plugged into the switch but i actually show it routing through mass only because it's using the same vlan but technically there's going to be two ports here on the same vlan one for mass and then one for the laptop that i'm going to be configuring so what exactly are the requirements for installing mass first of all you're going to need vlan capable hardware technically you could probably install mass without this there's different ways that you can integrate it into your network but the method that i'm going to be using is going to be taking advantage of vlans also you'll need a server with at least two gigabytes of ram of course four gigabytes or more are recommended but two gigs is pretty much the minimum and if i add up all of the storage requirements that's listed on the mass website it recommends about 50 gigabytes of storage i really don't think you're going to need 50 gigabytes of storage though i mean after you download more images and things like that it might actually grow to be that size but at the end of the day 50 gigabytes is probably fine and you could probably get away with less than that but i'm just going off the recommendations that are listed on the mass documentation page and that's what i came up with as for the server i do recommend that you use a physical machine although it's entirely possible to use a virtual machine if that's what you have access to in that case if you're going to use my method you'll have to make sure that your virtual machine solution supports vlans reason being the method that i'll be using will be taking advantage of vlans now with all of that out of the way let's go ahead and get started all right in order to install mass what we're going to have to do is set up our networking first so what i have here in my browser is my pfsense installation what i'm going to be doing right now is setting up a vlan for mass i want it to run in its own vlan its own subnet i basically want it to be separate from all the other networks that i have here in the studio now if you are ever curious what kinds of vlans i have here in the studio then you are getting a look at that right here this is actually my production pf sense server and the vlan that i'm going to be creating is going to be a vlan that i'll be using going forward so even though this video is just a tutorial and i have a demo server that i'll be using for mass i'm going to be using this particular vlan going forward so this is going to be a permanent addition to my pf sense installation what we're going to do is we're going to click on vlans and i want to add a new vlan for the parent interface what i want to do is actually choose the lan interface i don't want the mass server to be publicly available this is going to be used within my lan to actually provision servers so i really don't want this to be accessible from the outside so i'll select lan and then for the vlan tag we need to come up with a number that's not already in use i'll choose 900 for mine because that's definitely going to stand out it's a lot higher than any other vlan tag that i have so i'll just choose 900 for that for the description i'll type pxe this is going to be used for pixie booting and i'll click save so here at the bottom we can see the new pixie vlan that i've just created with the vlan tag of 900 just like you see here but we're not quite done yet even though we've created the vlan we actually have to put it to use just simply having the vlan in pf sense isn't enough we have to actually assign it and to do that i'll go here to interface assignments anyway i was able to get to this particular menu by clicking interfaces and then going here to assignments that's how i got to this particular page and this is the page that shows all of the vlans that i currently have configured now if we scroll down we have a section here that says available network ports what we want to do is drop this down and as you can see the new vlan is right here on the list so what i'm going to do is click on it and then i'll click add so i'll scroll down and we can see that the new interface has been added it's been given a default name though that i don't really like so what i'm going to do is click on this right here where it shows opt 8 obviously the number will be different for you but i'll just click on it right here we need to enable it very important and for the description i'm going to call it you guessed it pxe or pixie for the ipv4 configuration type we're going to set it to static ipv4 and then for the ip address what we're going to do is give it a subnet that's not currently in use and for mine what i'm going to do is set it to 192.168.200.1 and i'm going to set it to slash 24 and that should be all for this so i'll scroll down let's go ahead and save it let's apply the changes and then if we go to interfaces and then assignments yet again instead of showing update it's showing pixie for the name just want to make sure that everything is consistent and now it is so as far as pf sense is concerned there is one more step we need to go up here to firewall we're gonna go to rules we basically want to allow the traffic that is coming out of this particular vlan so what we'll do is click on pixie right here there's no rules currently let's go ahead and add one i'm going to scroll down here make sure this says pass and then we're going to go down here for the protocol we're going to set this to any i'll just give it a little description there and click save we'll apply the changes and that should be good now there's one more thing we should check we should go to services and then dhcp server each vlan can have its own dhcp server so what i'm going to do is click on pixie and we're going to make sure that this is not enabled the mass server is actually going to be the dhcp server for this network so we really don't need our router our firewall or whatever it is you're using to control dhcp we want to give that control over to mass so as far as pf sense is concerned we're all set here so the next thing that we need to do is actually configure our switch to understand that vlan to be aware of it basically and i've already pulled up mine i am using unify on my end so if you are using something else for your switch just make sure that you actually configure it similar to how i'm configuring mine there's probably thousands of different hardware configurations or more that you could have there's no way that i could show you all of them but basically what we're going to be doing is adding the vlan tag of 900 here to our switch so that way the entire network is aware of that vlan id in my case i'm going to click on settings and then i'm going to go to networks and then here we have all of the different vlan tags that i've already created so what i'm going to do is create a new network i'll name it pixi just like i did in pfsense we're going to set it to vlan only that disables the majority of the configuration here we don't really need to configure anything all we need to do is just make the switch aware of that vlan id that's it so we'll type that in right here make sure to use the same vlan id that you used in your router or switch and then we'll click save and that's it so now what unify is going to do is roll out this vlan id to all of my equipment which actually takes less than a minute in my case so when it comes to configuring the network i'm all set on my end so we can go ahead and move on and install ubuntu server and what you're seeing on your screen right now is my tiny pilot kvm this is something that i've reviewed in a previous video i'll leave a card for that right about here and tinypilot is pretty awesome it's a really cool kvm solution i highly recommend it and i'm using it in my case because this particular server doesn't have an html5 console that i can use via the web browser so the tiny pilot effectively gives me the same thing now speaking of server i'm actually using a server that was provided to me by tom lawrence who donated this server to the channel to help me create tutorials for you guys definitely check out his channel it's awesome i'll put a link to it down below in the description so be sure to check it out especially if you love networking storage and virtualization hardware he has a ton of videos about that stuff anyway as you can see here i went ahead and powered on my server in my case i pressed f11 to access the boot menu i've already created a bootable flash drive for ubuntu server so if you don't already know how to do that i have an entire video that shows you how to create bootable media from iso images but basically what you do is you just go ahead and use something like usb imager that'll help you convert your flash drive into bootable installation media for ubuntu server and then you can get started so what i'm going to do is boot from the flash drive it has a very strange name but anyway i'll press enter on that and that'll start the installer for ubuntu server and as you can see here the ubuntu server installer has started and it's ready to go now if you weren't already aware i have a brand new book out that covers ubuntu server 2004. it covers it in great detail and i highly recommend you check it out go to ubuntuserverbook.com if you want to go ahead and snag a copy for yourself but anyway let's go ahead and get the installation started so here i'm just going to press enter because the default of english as far as the language is concerned is correct and the keyboard settings are correct as well and this kvm can be a little large at times so we have the done button down here so this is a little larger than my browser is so since we have done highlighted here i'll press enter okay so right here we have our primary ethernet interface and as you can see it was able to get a dhcp address which actually means that i didn't configure the switch port that this particular server is plugged into to be using the new vlan that we've just created so i'll go ahead and fix that and i'll be right back all right so now that that's taken care of what i'm going to do is go ahead and configure this ethernet interface right here to use a static ip rather than dhcp earlier we made sure to not enable the dhcp server for this vlan so if i don't configure it to use a static ip then well it's not going to have any connectivity at all so i'll press enter then we'll go down to edit ipv4 so next what i'll do is press enter right here where it shows automatic and i'll change it to manual then for the subnet what i'm going to do is type 192 168 then dot 200.0 slash twenty four and the reason why i typed dot zero instead of dot one is because this is actually asking for the network subnet not the ip address so in networking when we're referring to the entire subnet we refer to it as dot zero slash 24 at least in the case of this particular network that's beyond the scope of this video now for the ip address i'll give it 192.168.200.2 and the reason why i didn't give it.1 is because if you recall dot 1 is the default gateway that's the ip address that we designated as the default gateway when we created the vlan in pfsense so since we've already used that particular ip address and it is the default gateway we can't use it as the ip address of our mos server so i just gave it the next available ip which is going to be 192.168.200.2 and that should work out great for what we need today for the gateway like i just mentioned it's 192.168.200.1 that's going to allow this mod server to route back to pfsense and actually access the internet so that should work out for that and then for the name server i'm going to set that also to 192 168 200.1 my pfsn server is also a dns server so it'll use the same address for this and my local network here is actually home hyphen network dot io so basically on your end you just fill out all of these fields with all of the values that are specific to your network you can use the same values that i'm using here if you want to and if those values don't collide with anything else that you have in your lan once you have all of this filled out we'll go down here to save we'll press enter it looks like that's done so let's just go ahead and navigate to the bottom make sure we choose done i'll press enter for the proxy i'll just press enter and for the mirror the default is fine for that as well i'm going to use the entire disk this will blow out everything on the disk so just make sure that you're choosing a disk that has absolutely nothing on it that you care about and what i'm going to do is allow it to claim my sata dom which is what this is right here if you'd like to choose a different disk if you can highlight the selection press enter and you'll get a list of all the storage devices that exist on your server i'm going to go ahead and leave it on the default it actually chose the correct one automatically which is pretty cool so go down here to the bottom choose done so at this point it's giving us a quick summary right here of all the partitions that it wants to create so what i'll do is just select done yet again and then i'll go down to continue yes i am sure i want to wipe out the disk that is totally fine and then here we get to fill out the information for the primary admin user i'll just keep mine simple i'll call mine mass for the username i'll keep that simple as well same for the password should be good to go so here we have an option to install the openssh server and i do recommend you do that if you press the spacebar that's going to put a little x there in the box that means that we've selected that particular option we do want that if you do have an ssh key that you have hosted online you can import that here it's a bit beyond the scope though i just want you guys to be aware that that is a possibility anyway scroll down here to the bottom and select done so here on this menu we have various things that we can have pre-configured for our ubuntu server if we'd like but i'm going to ignore these and we won't be selecting any of these i'm sure they're very useful but they're beyond the scope for this particular video so i'll press enter on done so up here it shows that the installation is complete so what we're going to do is go down here to reboot and we'll press enter so the server has finished rebooting and it's ready to go so now i'm here at my terminal ready to ssh into the server and start the next step so what we're going to do in this section of the video is actually install mass so next what i'm going to do is use ssh to connect to the server and we're in now although it's optional i highly recommend that we do everything from within tmux tmux is a terminal multiplexer that allows you to keep everything running even if you lose your connection losing your connection in the middle of a package operation for example that would be really bad but if we're running everything within tmux and we lose our connection no worries because tmux keeps everything running and we could re-establish our session when we reconnect again tmux is completely optional i just think it's a really good habit to get into when you're performing maintenance on a server so i'll type which and then tmux to see if we already have it installed and we do at least in my case if you don't see any output here that means that you don't have tmux on your server if you don't have it installed already then what you could do is run sudo apt install and then tmux and that'll get it installed but i don't need to do that since i already have it installed so i'll simply run tmux just like this and now tmux is activated you can tell that it's activated because we have this green footer down here at the bottom of the terminal window but don't worry so much about how tmux works i have a complete tutorial series that goes over tmux if you're interested but for the purposes of this video we're only using tmux to keep our session alive if something was to happen to our connection so just simply having it running is good enough for us so next let's go ahead and update our package sources so i'll run sudo apt update and this will help us make sure that our local index is up to date and right here we can see that we have 14 packages that can be upgraded so we should go ahead and take care of that so for that i'll run sudo apt and then dist hyphen upgrade just like that i'll press enter again and now at this point we have every package updated on our server so what i'm going to do is run sudo reboot we want to make sure that we're running all the latest updates so i'll press enter and then i'll give it a few minutes to reboot and then i'll be right back all right so i think enough time has passed the server should be up and running by now so let's try to reconnect and there we go so now that we have every package updated let's go ahead and install mass and that's actually the easiest part of this entire video we simply run sudo apt install and then mass just like that and for this message right here we can safely ignore it i'll press tab that puts the selection on okay i'll press enter and that's all there is to it and before i get too much further i'll make sure that i have tmux activated again it's not required it's just a precaution but anyway we have mass installed so now we can go ahead and initialize it so for that we'll run sudo mass and it just like this i'll type in my super secret password preferably i'll type it correctly for the region i'm going to select all and that's actually the default anyway so i'll simply press enter for the url i'm going to leave that at its default as well just make a mental note that mass runs on port 5240 by default and the url that you see on the screen right now is actually the url that you'll use to access this in your web browser anyway i'll press enter so next i'm going to set the username for the admin user that'll be used to configure mass i'll just set mine to j simple enough and for the password i'll go ahead and type that in right now and again for the email you actually will want to fill this in if you try to press enter and skip this at least in my experience it won't create the user so i'm just going to type this email right here we have to put something in this field i'll press enter and for the ssh keys i'm not going to do that i'll just press enter to bypass this particular prompt and that should be it mass should be installed and ready to go right now all we had to do was install the package and do the initialization which we've done so now it's time to log in so i'll open up firefox here type in the ip address of the mass server and it's running on port 5240 and then slash and then slash mass and all caps so here we have the login screen so what we'll do is enter the user info right here the same user info that we entered in during the initialization process so i've typed in my username and now i'll type in the password since this is the first time that we've ever logged into mass on the server we have some configuration to go through here so for the dns forwarder i'm just going to set it to google's dns you could use whatever you'd like for this doesn't really matter it just has to be a valid dns server and this particular dns forwarder is going to be where mass sends its external dns lookup requests so i think google is probably good enough for now i'm going to leave all of this at its default and in this section right here what we're going to do is choose which images we want to have installed and ready to go in my case i'm going to make sure to select 2004 as you see here and then i'll click update selection and the images that you selected should immediately start downloading so what i'm going to do is just let it set on this screen and then i'll be right back as soon as it's finished so as you can see here both of these images were downloaded and they've already synced it took quite a bit of time on my end because i was actually using a usb ethernet adapter long story but downloading images and masks is one of those things that can take a bit of time so it is what it is so scroll down here to the bottom and i'll click continue so down here it's telling me that mass has been successfully set up and according to this once i enable dhcp i should be able to pixie boot servers and get them bootstrapped which is pretty cool so i'll scroll back up i'm going to skip this section here and here we are on the dashboard so the next thing we'll want to do is enable dhcp so i'll click on subnets and right here it's telling me that dhcp is not enabled on any vlan and i already knew that so i'll dismiss this and right here i'm going to click on non-tagged underneath vlan for the network that we're using and we know this is the correct one because it has the subnet right here so i'll click on it and then i'll scroll down here and we have a button that says enable dhcp so i'll click that and it's going to give us a default range right here in my case ip addresses that are served via dhcp for a mass are going to end in 191 through 254. you could change that if you want to go ahead and narrow that down or widen it up it's up to you but anyway i'll click configure dhcp and now that's enabled so what i'm going to do at this point is switch the screen recorder over to a laptop that i'm going to use as if it were a server what i'll do specifically is i'll attempt to pixie boot the laptop and if all goes well i should be able to deploy an ubuntu image onto the laptop so what i have here on the screen is actually the boot menu of my latitude e 6430 laptop this particular laptop is quite old but it's still a good one and i'm just going to use it as if it was a server so what i'm going to do is attempt to pixely boot it so i'm going to scroll down here and let's attempt to boot via the onboard nic ipv4 specifically i'll press enter wow would you look at that it's actually downloading the netboot image right now and as you can see it's booting under mass and check this out we actually have the laptop right here it gave it a random name an interesting name at that almost looks like an ubuntu release name so that means our server while in my case laptop was able to pixie boot into mass and it's right here ready to go well actually it's not quite ready to go yet what we're going to need to do is actually deploy ubuntu to it because that doesn't automatically happen right now it's commissioning and mass is basically taking an inventory of the machine it'll probably have some of the info already if i click on it and it does so we can see what kind of cpu is on this machine how many cores we have storage we have all kinds of information here about this particular machine so now the status changed to new and the laptop has shut down and that's normal essentially what happens the first time is that the machine boots via mass mass takes an inventory of it and then shuts it down and now that mass is aware of this particular machine we can go ahead and deploy ubuntu to it first of all what we'll need to do is click on configuration and we need to select a power type what i'm going to do is choose manual but if you're using a specific type of hardware that matches a power configuration on this list you could choose that instead but in my case i'm going to choose manual what that means is that power control is actually going to be up to me because manual means well manual mass will not be able to automatically configure power up or power down on that particular machine that's okay in my case because it's just a laptop anyway so i'll click save changes so next i'll click on machines you see the machine right here so what i'm going to do right now is power on the laptop i'm going to pixie boot it yet again all right so it's booting right now so what i'm going to do is go ahead and click take action and we'll commission the machine i'm going to remove this test right here we don't need to do that that's just going to add additional time we simply want to make sure that mass is able to control and adopt this machine so i'll click commission one machine and off camera i'm basically going to pixie boot the machine again just like i did before and now it's net booting it should show us available here in mass pretty soon you can see that the status changed to performing pixie boot as you can see here so right now it's just gathering information so i'm going to let this run and then i'll come back and we can go ahead and proceed to the next step all right the status changed to ready so i'm going to click on take action i'll click deploy and i'll leave it on the default here for ubutu 2004 and actually down here it's giving me a warning that login will not be possible apparently because ssh keys have not been added to the machine so let me go ahead and click on that so what i'm going to do is just click on my name right here and i'll click on ssh keys and i'll go over here to my terminal and since i don't already have an ssh key on this system i'll just generate one right now if you already have an ssh key you can skip this step i'll simply run ssh keygen just like that i'll press enter to select the default path enter again for no passphrase a passphrase is actually recommended but i'm just going to keep it simple for this video i'll press enter enter again that should be all there is to it next i'll just type cat and then the tilde for the home directory then dot ssh slash id underscore rsa.pub we want to cat out the public key and i'm going to copy all of this text right here and then back in the browser i'm going to import an ssh key i just click upload i'll paste it right here i'll click import and right here it says that the key was successfully imported so back in machines i'll click on this one right here i'll click deploy and again we're going to deploy ubuntu 2004 i'll click deploy again and then next what i'm going to do is start the laptop i'm going to pixie boot it yet again and now we're booting over pixie boot so this should be fun let's see what happens now we're fetching the netboot image so far so good all right so now the status has changed to installing os that's a great sign as you can see it's booting right now we have all this scrolling text all over the screen that's a really great sign and now we have the login screen and since we deployed ubuntu server to the laptop there's going to be no gui as of yet but as you can see right here we have the login screen so that means it's working so what i'm going to do is just use ssh to connect to that machine i want to show you guys how to ssh into an ubuntu machine that was configured via mass the username by default is ubuntu and then we type in the ip address if you don't know what the ip address is you can get it from mass so i'll type that in right now it was given 192.168.200.4 so i'll press enter and as you can see i was able to log in how cool is this we've successfully used mass to deploy ubuntu server over to a laptop which is a great proof of concept because it doesn't matter what kind of hardware it actually is again whether it's a laptop a desktop a physical server virtual machines even mass is able to configure all of those and more but as you can see the process was a success we deployed ubuntu so we're good to go so there you go as you can see mass is awesome and i had a lot of fun making this video for you guys i've actually been wanting to do this video for quite some time now and i'm glad that i finally got the chance to do so so what did you think about this video or mass in general let me know down in the comments below i look forward to hearing what you guys have to say if you like this video please click that like button and also subscribe if you haven't already done so because i have some awesome content coming very soon thanks for watching [Music] you
Info
Channel: LearnLinuxTV
Views: 8,494
Rating: undefined out of 5
Keywords: Linux, Tutorial, Review, Howto, Guide, Distribution, Distro, Learn Linux, open-source, open source, gnu/linux, LearnLinuxTV, maas, metal as a service, deploy, provision, pxe, pxe boot, network boot, imaging, server image, deploy server, physical server, openstack, canonical, how to install maas, private cloud, ubuntu server, open infrastructure, ubuntu (software), maas ubuntu, ubuntu server tutorial, ubuntu server tutorial for beginners
Id: rbkB25kaBmU
Channel Id: undefined
Length: 38min 47sec (2327 seconds)
Published: Mon Nov 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.