OpenStack Tutorial – Operate Your Own Private Cloud (Full Course)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi i'm beau carnes with freecodcamp.org in this course i will be teaching you the basics of openstack and how to use it openstack is an open source software that provides cloud infrastructure for virtual machines bare metal and containers to follow along with this course it can be helpful to have a basic understanding of the linux command line networking and virtualization but none of that is required by the end of this course you will have a core understanding of what openstack is and you will know the basics of setting up and administering openstack using the openmetal platform you'll also understand some commonly used openstack services so let's talk more about what openstack actually is openstack is an open source cloud computing platform that is used by organizations to manage and control large-scale deployments of virtual machines such as in a cloud computing or virtual private server environment openstack is a popular choice for organizations because it's scalable reliable and provides a high degree of control over the underlying infrastructure besides being used to manage deployments of virtual machines openstack can also be used to manage storage and networking resources in a cloud environment in some ways openstack can be compared to aws but here are some key differences between the two openstack is an open source platform while aws is a proprietary platform openstack offers more flexibility and customization options than aws openstack typically requires more technical expertise to set up and manage than aws since you basically have to set up everything yourself in the past beginners had trouble getting into openstack due to its complexity and difficulty in being set up for smaller teams but new technology has come out to make openstack available as a service which opens up the door to this super powerful open source cloud system this video can be followed by beginner admins but infrastructure focused people like devops and system teams should find this very valuable let's go into more detail about what openstack offers beyond standard infrastructure as a service functionality additional components provide orchestration fault and service management and other services to ensure high availability of user applications openstack is broke up into services to allow you to plug and play components depending on your needs this openstack map shows common services and how they all fit together i'm not going to cover every service here but let me tell you what some of the more common openstack services do openstack object storage or swift is a highly scalable distributed object storage system openstack block storage called sender is a service for managing block storage devices openstack compute called nova is a cloud computing fabric controller which manages the allocation of compute resources openstack networking called neutron is a system for managing networks and ip addresses the openstack dashboard which is called horizon is a web-based interface for managing openstack resources openstack identity called keystone is a system for managing user accounts and access control openstack image called glance is a service for storing and retrieving virtual machine images openstack bare metal called ironic is a service for provisioning and managing air metal servers so those are some of the more common services and we'll be demonstrating some of them later in this course there are a bunch of different ways to deploy and configure openstack based on the needs of your application or organization so we're about to learn how to get started with openstack and use many of the most common features one of the easiest ways to get started with openstack is by using the openmetal on-demand private cloud this allows us to quickly deploy openstack to the cloud and simplifies the setup process openmetal provided a grant that made this course possible while we'll be using openmetal to learn about openstack the material covered in this course applies to any openstack deployment not just ones that use openmetal so no matter how you want to use openstack this course is for you and feel free to leave a comment with anything that you're learning or any questions you have about this content so let's look at how to set up openstack on openmetal to get openstack set up you need to provision and set up your cloud on openmetal we'll just follow the prompts on this openmetal central page to get everything set up during the setup process you're going to have to enter a public ssh key later when we went to ssh into one of the cloud servers the public private key pair will basically act as our password or our login information to ssh into the server so to get a public ssh key there's a few different ways but the most common way is to go over to your terminal or your command line now this is going to work pretty similar whether you're on windows mac or linux there is a program called ssh key gen so if you just type in ssh key gen it will generate a public private key pair now you may have to install the ssh key gen program on your computer but also it may already be automatically installed so i'm not going to go through the whole generation prompts because i've already generated it so once you've generated it you're going to have to get access to the private key that you generated so i'm just going to cd into the change directory into the my ssh folder and again this is the same on windows or mac or linux now if i list everything in here we can see all the the keys now i've already renamed my private key to have the extension.pem yours may not have that extension but it doesn't matter whether what the extension is and right now we're trying to get the public key anyways so we're going to just have to open up this file with the public key now depending on your system you may be able to use vim or some other text editor to open up this public key i'm just going to use vim on my system and open up the public key and then i can copy this public key if i go back over to my web browser i'll just paste it in to load it up and then i'll just finish setting everything up here openmetal private clouds are deployed with openstack to three bare metal servers these three servers comprise the private cloud core to open stack these three servers are considered the control plane private clouds are deployed with ceph providing your cloud with shared storage ceph is an open source software defined storage solution and we'll be going into more detail about ceph later in this course now let's view the hardware assets that were created on openmetal so if you just created a cloud you may already be on the cloud management page if not if you're not on this cloud management page you may be on this page and you just have to click manage now let's click assets on the left side menu this page contains a list of assets included with your private cloud deployment these include your hardware control plane nodes and ip blocks for inventory and also the provider ip address blocks the private cloud can have different hardware based on the options you selected in your deployment so if you're following along you selected the same things as me it should look pretty similar to this so these up here these things these three here these are three cloud core mb small v1 control plane nodes and then the inventory i p address blocks and the provider i p address blocks with these private clouds openstack is deployed with three hyper-converged control plane nodes now let's see how to access these control pane plane nodes so these are the nodes and you can access these control plane nodes directly through ssh as the root user if we go back over to the my cloud page it gives you some instructions on how to access so if we go to these this access things you can see it gives you instructions you can see it says two one seven two one just i wanna show you that that's the same ip address as the first one here two one seven two one so when you're accessing your your cloud you should generally access just the first one at one of these cloud course malls so let's go back over here and it's gonna show us what we need to do to access our cloud so we can access through the ssh key we provided during the private cloud deployment so we're just going to use this command here you will obviously have to change the key name and ip to match your information but let me just copy this and i'm going to go over to my terminal okay i'm in the terminal and you can see here is the ssh command it's not the exact same as the one we just copied because i've updated it to have the file name of my ssh key now yours may not say dot p e m on the end you may just be doing id slash rsa or underscore rsa that's the most common way to do it so this is basically the password to log in to our node so i'm just going to hit enter here and insert the pass key okay we are logged in here so we're logged in as a root now if we go back to this page we can see that the end goal isn't just to ssh into our node we are actually trying to get into the openstack dashboard horizon is the name of the default openstack dashboard which provides a web-based user interface to openstack services it allows the users to it allows a user to manage the cloud through a graphical interface so to access the new cloud's openstack dashboard which is called horizon we'll need to first obtain the horizons administrator password the username by default is admin and this is showing right here what we need to do to get the password to log in so after we log into this node which we have done on our terminal i'm going to copy this command here so basically this command is going to display our password on our command line so let's go back over to our terminal and just paste in that command there and now we have the keystone admin password so i'm just going to copy this password here and then if you go here it shows you that we're going to get the keystone admin password now that we have the password we can launch horizon on open metal you can click the horizon tab on the left menu so you can see down here i'm going to click horizon it's opening into a new tab and so i just opened to a new tab let me zoom in a little quick a little bit here and i'm going to use the username admin and then i'm just going to paste in the password i just copied from the terminal i'll click sign in okay we're signed in to open to horizon and it's the openstack dashboard now this is going to look pretty similar no matter where you're hosting your openstack so we're using open metal but there's plenty of other ways to host openstack and everything on horizon is going to be basically the same no matter where you're hosting so the first thing we're going to learn to do is to create a project in openstack the cloud is divided through the use of projects projects have associated with them users who have differing levels of access defined by roles an administrator defines resource limits per project by modifying quotas so let's learn how to create a project and associate a user with it and we'll learn how to how project quotas can be adjusted and like i said this interface will be similar no matter where you deploy openstack so there are three root level tabs let me close so you can see we have the project tab the admin tab and the identity tab only users with the with administrative privileges can see the admin tab so some people may just see project and identity so to create your first project let's go to identity and then projects so you'll see that several projects already exist including the admin project that's right here so these projects are deployed by default and generally should not be modified but we want to create a new project so i'm just going to create or click the create new project button right here and then we just have to fill in some information i'm just going to call this deploy development and you can see it's already giving me a suggestion because i've tried this before so a description will just put development project and you can basically use any name or description that you want so you can also add project members or project groups but we're not going to cover that just yet right now i'm just going to create the project and finish creating the first project so create new project development and then you can see it right here so once created the project appears right in this page now while in this project listing page you can view and adjust quotas for this project as the admin user quotas are limits on resources like the number of instances so to view the quotas for this project um we're in the identity projects tab still so now we are going to go to this drop down on the right so we have our project we just developed and then i'm going to click this drop down and go to modify quotas and these are all the default quota values so quartz also exists for the the volume and the network and if you set a value to negative one that means the quota is unlimited we're just going to use all the default values but it's good to know where to go if you want to change these in the future so i'll just click cancel we're not going to save this and now we're going to discuss how to create a user and associate that user with a project so we have the project and we're going to associate a user so there's already the default admin user but now let's create a new user and log in with that user so first we will go to identity users and this only works when you're logged in as admin or a user that has admin privileges so i'm going to um well well first of all you can see that there's several users that already listed and this is expected these are created during the cloud deployment and they generally should not be modified so to create a new user we'll just click create user and then we can just create we'll just put in a username password primary and then we'll just fill in all this information so username i'll put bo you can see description is uh optional and for user name i'll just put boa freecodecamp.org i'll put in my super secret password [Music] and then i will select a project so i'm just going to select development the project that we just created and then if we click the drop down on roll you can see there are several different options and which obviously depend you choose different roles depending on the level of access required the default open stack roles are this reader member and admin so the reader is the the least authoritative role in the hierarchy and for this example we will choose member which is kind of like the middle middle authority role and then i'll just click create user okay next we're going to log out of horizon i'm going to click this drop down and go to sign out and i'm just going to log in with the new user bo and then i'll put in the password and click sign in okay we're logged in with the new user upon logging back in where the we're by default in the newly created project you can see the project we're currently on as you can see it says development this is the project there's only one available because we've only created one project now let's talk about managing and creating images we'll learn how to upload an image not not a graphical image but an image as in a copy of a linux installation so we'll learn how to upload an image onto openstack as well as create images out of an out of an existing instance images contain a bootable operating system that is used to create instances you'll see that within openmiddle cloud there are several different images that are already available including os debian fedora and ubuntu in addition to this you have the option to upload images from other sources or create your own images we'll learn how to upload images to glance through horizon and how to create an image from an instant snapshot glance is a tool for managing instances that allows users to discover retrieve and regis register virtual machine images and container images glance uses ceph to store images instead of the local file system to access images within your horizon dashboard we'll navigate to the projects tab which we're already on here and then we'll go to compute and then we will go to images so this tab includes a list of all the images installed on openstack the images you see have been pre-loaded by open metal like i said there's already some that you can install now these are these images aren't deployed or anything yet they're just images you can use if you want so let's see how to upload your own image if we we can do that by clicking the create image button when creating an image you must choose the format of the image so before we start filling this all out we are going to need an image source we're going to need a file here so i'm going to if you want to follow along i'm going to leave a link in the description to a sir os image that you can use i already have it downloaded so i'll be able to select that file when we're filling this out so we're going to fill in the name sir os and then a description a ser os image and then i'm going to browse to find the image source okay i'll select that for the format i'm going to choose this qco2 dash i think it's chemo qemu emulator with our configuration the this is the recommended format qcal 2 is the most common format for linux kvm it expands dynamic qco2 is the most common format for linux for linux kvm and it expands dynamically and supports copy on write which is all useful for what we're doing so i'm going to select that and then i will just keep all these the default settings and i'll cr click create image now it could take some time to complete uploading the image but now we're done we can actually use this image so next we are going to create an instance in openstack horizon instances or virtual machines play allow a large role in a cloud's workload openstack provides a way to create and manage instances with its compute service called nova nova is the openstack project that provides a way to provision compute instances aka virtual machines novus supports creating virtual machines bare metal servers and has limited support for system containers nova runs as a set of daemons on top of existing linux servers to provide that service so let's see how to create an instance and we're also going to create a private network and router create a security group and see how to add an ssh key pair the first thing we'll do is learn how to create a private network and router and then later we'll create an instance on this private network so we're going to go to the project and network and networks so we're just about to create a network but later we're going to create a router the router is created so the private network can be connected to your cloud's public network allowing you to assign a floating ip address to it making the instance accessible over the internet but let's create a network by clicking the create network button so you can basically call anything you want we're going to use the name private and then we can we'll just leave all this set to the default options and before and now we're going to go to the subnet tab here and here we are going to first we're going to create a name for our subnet and we'll just use private subnet and then the network address we have to select the private network range so for this example just do uh 192.168.0.1 24 and then we'll leave this as ipv4 and then the gateway ip is optional if unset a gateway ip is selected automatically so we'll just keep it we'll just have it set automatically and we're not going to disable the gateway and for the subnet details uh we'll just we're not going to change anything we're just going to keep the default values here then i'll click create and then once it's created it will appear on this list here okay we next need to create a router to bridge the connections between the private network and the public network the public network is already here it's called external so to create a router let's go to the projects and network and then routers and then you may be able to guess we're just going to click create router okay we'll set a name i'm just going to call this router and we'll leave most of this to the default values for selecting the network we're going to choose the one we created external and then we're just going to click create router okay next we're going to connect the router to the private network by attaching an interface performing this step allows network communication between the private and external networks to attach an interface to the router first we'll navigate to the list of routers and select the one previously created so we're actually already on the list of routers so i'm going to click the router and then i'm going to go to the interfaces tab and then i'm going to click add interface okay for subnet we are going to choose the the private subnet that we created and if you don't set an ip address one is selected automatically which is what we want so i will press submit to attach the private network to this router the interface is then attached and now listed now i'm going to show you how we can visually see the network topology for the network for the cloud that we've created so i'm going to go to project network and then network topology so if i scroll down here you can see this it indicates that the external network is connected to the private network through the router called router and this is what we just created so it's like a visual representation of everything we've done so far now security groups security groups allow control of network traffic to and from instances for example port 22 can be opened for ssh for a single ip or a range of ips let's see how to create a security group for ssh access later we'll apply the security group we create to an instance so i'm going to go to project and network and then security groups so you should see this single security group called default this security group restricts all incoming or ingress network traffic and allows all outgoing or egress network traffic when an instance is created the security when an instance is created this security group is applied by default so to allow the network traffic your instance requires only open port as required to adjust the needed ip ranges to create a security group for ssh we will click the create security group button and i'm just going to name this ssh and then for the description you can add something or you can just leave it blank and then i'll click create security group and if you make a mistake like you accidentally put a lowercase s instead of an uppercase s we can go back to security group and then i can go to edit security group and then we can just edit the name just like that and then click edit security group now i'm just going to click manage rules here we'll go to that page we were at before so after creating the ssh security group we need to add a rule allowing ssh traffic we'll allow ssh traffic from the first hardware node on the cloud to this instance so i am going to click add rule we'll need to obtain the ip address of the first hardware node of the cloud because we only want to ssh into it from that hardware node so let's go back over to our open metal page i'm going to go to assets and then i'm just going to copy the ip address of this first hardware node now we can film this information so for rule we will go to ssh and then for description i'm going to put allows ssh from and then just that ip address that we just copied here and it looks like i copied some spaces so i'm just going to copy it again without spaces and for remote will leave cider and then i will just paste in the ip address here and then i'll just add this rule okay so now we can we can ssh into this network from from this specific ip address we now have almost everything in place to create an instance we'll need an ssh public key an sha and ssh public key is required to access an instance over ssh the key is injected into the instance when created we actually have already done this in this course because we needed an ssh public key in order to basically get this whole thing started that's how we were able to ssh into our node earlier like i said the key is injected into the instance when it's created so what we're doing is we're creating an instance that can be accessed over ssh from one of the cloud hardware nodes so we'll have to create an ssh key pair in one of the hardware nodes the public portion of that key pair is associated with the instance we'll create soon okay i'm back at the terminal i'm still logged into the hardware node where i got the password the admin password we used previously so if you're not logged into the hardware node you should log in again just like we did before and now we're going to create an ssh key pair and i'm just going to use the ssh keygen and this time i am going to make a pair of size 4096 bits so i'm going to do the dash b and then the number of bits 4096 and then i'm going to just press enter and i'll just use these default values if you've already created before like i have you can just override it but you probably won't have to because it will probably the first time and i'll create a passphrase okay now i just have to get access to the public key that we just created so i'll do cat root so here's the directory that i got stored in and the file name is id underscore rsa.pub okay so this is the public key i'm just going to select all of this and copy it now now that we have the ssh key for the instance we're going to create the instance that can be accessed over ssh from the cloud's hardware node so to do that i am going to go to projects then compute then instances and then launch instance so there's a bunch of tabs here we're not going to go through all of them but we're going to go through a lot of them some of them will just keep the default values so i'm going to create an instance name for this example i'm just going to use jump station you can call it anything you like and then you can optionally put a description i'm just going to keep the rest of these to their default settings and then i'm going to go to source now i'm going to make sure it's an image that we're booting from an image and i'm just going to keep all these default we are going to create a new volume now we have to choose which which image that we're going to use so for this example we're not even going to use the image we're not going to use the image that we uploaded we're going to use synth os 8. so we'll use the centos stream and i'm just going to click this up arrow and it's going to bring it right up into this allocated section so this is showing that we are going to be using the scent os 8 for the image on this instance now i'm going to go to the next tab flavor and this is all about defining vcpus ram and disk space used by an instance so there's a bunch of pre-built flavors and the one we're going to use is just called m1 small so i'm going to scroll down a little bit in one small and then click the up arrow here and it's going to have a set amount of ram disk space root disks and um next yeah so this is what we're going to use for the flavor now we're going to go to networks now i'm going to bring up the the private network the one that we created uh these provide the communication channels for instance for instances in the cloud and you can choose to add the external network as well but it's not really recommended it's better to use floating i a floating ip if your instance is going to require internet connectivity you should only expose portions of your network as necessary this reduces the attack surface and improves the application security if a private network is not created in an instance is created in a default cloud it's associated with the external network this means that the instance consumes a public ip and it could be reached over the internet so next we're going to skip over network ports and go straight to security groups and we're going to bring up the security group that we previously created the ssh one and then we are going to move to key pair you can upload your key at the stage using the form using the import key pair here you can also create a key pair on this tab we already created the pair earlier from the first hardware node in the cloud so we are going to just use the the key that we already created so we're going to click import key pair and then i'm going to just name this jump station key and the key type is going to be ssh key and then you can either choose the file the key or i can just paste it in here remember we copied it from our terminal and then i'll just click import key pair once the public key is imported we'll create the instance by pressing launch instance the other tabs are just outside the scope of this demonstration here so the instance is going to go through a build process so you may have to allow a few minutes for this to occur and when complete the instance will appear in the instance listings page well i guess it's already appearing here it's just not it's still spawning as it says here and now it's complete it's done the instance has been created now we are going to assign and attach floating ips basically an ip that people can access to get to this instance the only way to connect to the instance is by exposing it via the floating ip or another instance in the same network i'm just about to show you how to allocate a floating ip and attach it to this instance so we're going to start by going to project here and then we're going to go to the network tab and then floating ips and then allocate ip to project we'll make sure the pool is set to external and then we can add a description if we want it's even it's optional you don't even have to and then click allocate ip now we want to allocate the ip to the jumpstation instance by clicking this associate button here so we have the ip address already filled in here and we'll select the port and the port will click the port that we called jumpstation and then click associate so this instance is now available over ssh from the first hardware node in the cloud so let's try logging in to the instance so first of all i'm going to copy this ip address and then i'm going to go back over to the terminal we're already logged into the hardware node if you're not anymore you can re-log into the hardware node over ssh and then we are going to ssh into the instance we just created so i'll do ssh dash i and now i'm going to put in the path to the private key that we created and this private key is basically like the password to log into this instance so it's root slash dot ssh slash id underscore rsa and then i'm going to put in the ip address oh but first actually before the ip address that we copied earlier i have to put in the username which is going to be sent os because that's just the default username of the operating system we installed on this instance okay now i'm going to press enter here and then it's going to see if i ask if i want to continue connecting yes and now i can enter the passphrase that we created that i created when i developed the the private key pair the public pirate key pairs so put in the passphrase and logged in great in the next section we'll do something while logged into the machine but for now let's go back over to the openstack web interface so far we've been learning how to manage openstack through a web browser that's this one right here but it's also possible to manage through the command line using openstack's cli called openstack client using the command line to manage your cloud introduces more flexibility in automation tasks and can generally make an administrator's life simpler so let's learn how to get that installed we'll install the openstack client cli on the instance we just created that we named jumpstation before installing openstack cli you must obtain two files from horizon which are required to prepare your shell environment so let me show you how to get those files and talk more about them i'm going to click where it says api access right here and if i click down here it's going to show two different files that we can download and we need to download both of them the openstack the clouds.yaml file and the rc file clouds.yaml is used as a source of configuration for how to connect to a cloud and then the openstack rc file is used as a source of authentication for the user and project and so i've now downloaded both of those files and now we need to prepare and install openset client so i'm going to go back over to the terminal and i'm still logged in to the instance the instance we created previously so let's go through the steps to prepare and install the openstack client so first we need to prepare the clouds.yaml so first we need to get the files that we downloaded pre just now onto our local machine we need to transfer them to this instance so let me show you how to do that first we're going to get the clouds.yaml file over to this instance i'm going to start by making a directory honor instance so make directory and i'm going to call this it's where the directory is going to be slash dot config slash open stack now that i've created the directory so i'm going to create and open a blank clouds.yaml file i'm going to use the v editor so if i use the v command and i put in a file name it will open a file to start editing and if the file doesn't already exist it will create that file so i'm going to navigate to the directory that we just created and then i'm going to call this clouds.yaml okay now we have to get the contents from the cloud.yaml file on our local computer into this instance so basically we're going to open up clouds.yaml in a text editor on our local computer okay so i got clouds.yaml open i'm just going to copy this this is just in sublime text on my local computer you can open up up in any text editor now i'm going to go back to the the v or vitex editor on the instance and i'm just going to paste in the contents of the file now to save it i'm going to hit the escape key then i'm going to hit the colon key and then wq w for write or save and q for quit okay so i just saved the the clouds.yaml file onto here and now we are going to do the same thing with the openstack rc file oh and by the way the clouds.yaml file can actually be saved in a few different locations but the one we saved in is a is a common place to save the file so the the openstack rc file it doesn't really matter where you save the file so i'm just going to save it um basically right where we're at right now so i'm going to do v and then i'm just going to call the make i'm going to create and start editing a file called development [Music] dash open rc.sh this is going to be a shell file that we can run it'll allow us to run commands now i'm going to open that file on the local machine okay so i'm just going to cop or select all the file copy and go back to the instance here and just just paste in the contents of the file and again i'm going to press escape then colon then wq and that's going to save and exit the file now we'll source the development openrc file which will allow us to run openstack commands and i'll have to put in my openstack password now we are going to create a python virtual environment we're going to create the virtual environment so we don't interfere with the system's python version in the default synth os 8 stream installation the systems the systems python execute executable is called platform python so we're going to use that to create the virtual environment so let me show you first we have to access we have to put in the directory where the the python version is on this instance which is that at this um at this spot on the computer lib exec slash platform dash python and then we have to v e and v is how we're going to create the virtual environment and we're going to create the virtual environment at this directory at this path slash v e and v okay uh we created that and now i just need to activate the python virtual environment so i'm gonna do source and then v e and v slash ben slash activate okay we know we're activated because we have this this is the name of the virtual what we call we this is the name of the virtual environment right here next we need to upgrade pip pip is used to install um different python packages on the instance so i'm gonna upgrade pip with the command pip up pip install upgrade pip okay now we need to install openstack client which is what we've been working toward this whole time so there's two openstack packages but the one that is kind of maintained more is called python-openstack client so we're going to do pip install python dash open stack client okay we now have the openstack cli installed on our instance so there's quite a few things you can do with this cli we're not really going to cover all of them or very much but i'm going to just show you a few things like one like for an initial command we can list the servers associated with the project so i can do open stack that's how we start the openstack cli and i'm going to put server list okay and actually i'm going to zoom out so this looks better [Music] let's zoom out quite a bit for this to okay there we go so we can see we just have one server this is the one we create jump station we call it jump station remember we chose an m1 dot small for the flavor and so this is basically the server that we previously created i'm just going to zoom in again here and when using the openstack client there is typically a common command pattern for what you want to accomplish all openstack commands begin with openstack you can execute openstack by itself to enter into a shell where commands no longer need to be prefixed by openstack so i can just type in openstack and now we can type in any command so we can do the server list and it's going to basically show this the same thing from before i'm not going to zoom out again so you can see what i'm typing in a little more but let's go out of this and now i'm just going to run openstack from the command line again and if you use open stack help then we can list all available sub commands initially see all the flags that you can pass but after scrolling a bit uh you'll see that the command list will start here so these are all the the commands that we can we can use and i'll just quit out of that before we see all of them because there's quite a few uh if you see after you see the available commands you can learn more about a command just using openstack help this is like a lot of clis we can just do openstack help and let's say we want to know about the server command open so if we do that then it's going to show the different commands we can use with openstack server so these are all the things that we can do with a server it's very common when using openset client to list items and the command format is typically the openstack sub command list so for instance we can do opens openstack server list and so that's gonna list the servers just like we had shown before you can also get more information about an item by using the show command so let me give you an example we can do open stack server show jump station so the the name of the server and here we're going to show details about the server so there's quite a bit more you can do with the openstack open stack cli administrators generally use the cli if they need complex options as they may not be available through the graphic user interface but that's basically all we're going to talk about in this course if you're interested in any particular thing you can just look up the documentation to figure out how to do what you want to do in the cli so now we're going to talk about how private clouds are deployed we're going to learn more about how your private cloud is deployed and learn more about the environment openstack can be deployed in several different ways and this section highlights the characteristics of this private cloud we're going to explain some of the advantages of this type of deployment and some things that are unique to open metal let's talk more about the containerization of openstack like i mentioned open metal uses cola ansible and it uses it to set up docker containers for running services so if you need to make any configuration changes to your nodes cola ansible should be used to push those changes if it's not used then there's a risk of the changes being reverted during the system updates some advantages of containerization through docker are that the containers create an isolated environment reducing software dependencies containers can be scaled and allow for services to balance across your cluster containers provide increased flexibility for test releases patches and automation and containers have a consistent and repeatable deployment and a shorter initialization time in openmetal disk storage is provided through ceph ceph is an object storage interface that can provide interfaces for multiple different storage types on a single cluster and openmetal ceph is comprised of two elements object storage and block storage the ceph object storage utilizes the stuff object storage gateway daemon with open metal clouds ceph's rgw replaces swift so there is no docker container for swift instead swift endpoints are connected directly to the rgw authentication for rgw is handled through keystone seth block storage connects to the sender service utilizing ceph's rados block device within the cloud these objects are stored in cephpools seth provides a layer of abstraction that allows objects to be recognized as blocks some advantages of using ceph are data is self-healing and will will redistribute data across your cluster in the event of power hardware or connectivity issues also data is replicated and highly available and seth has the ability to run on common commodity hardware and to mix hardware from different vendors ceph was selected as the storage solution for private cloud core openstack clouds due to its ability to store data in a replicated fashion the data stored in the ceph cluster is accessible from any of your cloud's control plane nodes the storage is considered shared across all nodes which can make recovering an instance and its data trivial so let's learn how to check the status of your ceph cluster and see available disk usage using the command line so first let's make sure we're logged into the clouds one of the cloud control plane nodes not an instance so if you're logged into the instance before you have to log out one layer to the control plane node but not log out so far that you're on your local computer so to check the status of the ceph cluster we can use ceph status so i'll just do ceph status and then we can get a lot of information about um how like like we can get the uses information number of objects the number of pools and stuff like that and to check the available disk space in your ceph cluster we can use seth df and we can see that how much we have available how much has been used and a lot of information about the various pools now let's look at how to find the resource usage of the private cloud we'll explore how to utilize the horizon dashboard to determine the total memory and compute usage for a project as well as how to view instances stored on each node then we'll look at disk usage by explaining how to briefly interact with the cloud's ceph cluster using the command line and finally we'll go over adding and removing nodes from the ceph cluster there are currently three variations to private cloud deployments small standard and large all private cloud deployments have a cluster of three hyper-converged servers but will have different allocations of memory storage and cpu processing power depending on the configuration and hardware in addition you have the option of adding additional hardware nodes to the cluster so let's view the resources used by the cloud we have to be logged in as the admin user so i'm going to sign out and then i'm going to login as admin if you remember to get the password we actually have to log in with our command with the command line so let's go over to the command line and we're already logged in so i am going to use this line right here grep keystone admin password and then the path and then we can get the admin password you can always change this if you want to make it uh something that's different than that but i'll sign in here so once we're in the admin project i'm going to navigate to admin compute hypervisors and this is going to show a few items the vcpu usage the memory usage and the local disk usage there's also an option to see the location of your instances within your cluster to view this information we'll go to the admin compute instances here and then you have the option to see the the project the host as well as ip addresses and the status and just a bunch of other or in the power state and just a bunch of other things here to access information require regarding your ceph clusters resource pools you'll need to use ceph's cli so let's go back over to the terminal and let's just do some common useful resource monitoring and health commands so to check the status of staff we'll just do ceph dash s and so this is just a shortened version of one of the commands we used earlier and then you can do ceph df and again this is one that we've already covered but some new ones would be ceph health detail [Music] health okay and another one is ceph osd pool ls so lis this pools and we can add the detail like we can put images for additional this will give us additional details regarding replication and health metrics we've reached the end of this course you now know the basics of openstack now there's a lot more you can do with openstack but you should know enough now to start learning more on your own well thanks for watching
Info
Channel: freeCodeCamp.org
Views: 148,176
Rating: undefined out of 5
Keywords:
Id: _gWfFEuert8
Channel Id: undefined
Length: 57min 45sec (3465 seconds)
Published: Mon Jul 11 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.