Introduction to Nornir | Python Network Automation!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone its Jon and today we're looking at the Python based Network automation framework normally I know normally as I'm absolutely amazed until and I really think that anyone who's interested and Network automation really should be looking at it and so first off why even use normal nor near em allows you to perform parallelization with respect to your network automation so what does that actually mean now if you recall from watching my videos on net Miku and on me Pam forgot let me go hey Pam you'll notice not great tools but I'm not the fastest what they tend to do is you know if I'm here and I'm going to the base we go we create a connection that's won them back and number two then back then three them buy it and fold them back it's kind of come back and forward what nor does are allows you to push o all these commands concurrently and pull them back in so you get really really rapid responses and I just wanna show you just like while they've written em most of em but I wasn't and that's article or network floor it's an answerable versus not enough speed challenge and what I want it can I highlight and impress a point is that when you scale up to a massive size Network the tough ones and using normal starts to become really really apparent so like I said here are some of the differences well you can see straight away the blue is ansible and the green is normal see you when it comes to using master devices so for example where are we here ansible 10,000 devices were looking at what 22050 seconds that same task four more meters under 18 seconds so 18 versus twenty two thousand seconds if it's a beg beg tough ones so I really think you should be looking at this especially if you oughta mean already a large environment it's really going to help you and yes let's take on and do it so the first thing I kind of highlight is that normally is not a replacement for all your typical automation tools normally is actually going to integrate very tightly with napalm and net Meiko in fact the bolita developers david but also and cut bios to share it today in an amazing job unless they are actually clear those tools and normally integrates well with them so what you can do is if you actually look at the straps I'm going to show you and you'll see that we're actually using napalm and/or napalm in it and we call with then omnia and just to clear that up because some people seem to think that what isn't normally or maybe a tool and replacement for these tools no you user as a supplement it basically allows a greater performance of these tools okay so the way it's going to work is I'm going to show you two scraps the first scrap is pretty much straight off the normal front page the documentation just that's one it gets some information and the second one is based off a video I watched I want us to detonate by Stuart Clark he does some really really good work him and it's pretty much a sleep mortification on one of the other actors who actually does just because I think that's an issue worth normally or nowhere by I think it because it's a Python 3 unique a little bit of a change this I'm just gonna highlight that change and I've also put some a sin tax Highland and to maybe make it a little bit easier to see when you're either so that's pretty much the plan for today do those two steps and then the next normally of idea will actually go into actual configuration changes that's one is going to be a based around getting information from devices okay so what that said let's have a look at the scripts so if we just pull up um the terminal and I do an LS you see I've got that's natural folder here called normally or somebody just CD and in up and I've got a list of files here these two other scripts that's a little grip till you make no it's from my knee Parvati I'm gonna use that as well and the three things you really need to have configured to get you started normal as this conflict Aoyama that's grips Toriyama and the horse Tamil this is what normal needs to basically have basically operations so let's look at them and discuss some of them so the first one if we can't configure Mille you can t see factor of all person a actually share it to Johnny because Johnny gave me some Johnny's one of their subscribers here Johnny gave me some good feedbacks in that and the previous video when I thought struct in there is kind of hard to see the the actual thermal so I'm gonna use is actually use Nano and I've made the takes a lot about three Edinburgh Isuzu bellow but easier to see so thanks for that and so confident so have a look here and what we need to is saruyama format so we start with three little hyphens and what we need to do is tale use tell more music or what to do and that's is basically num underscore what causes how many concurrent connections that Norman is going to make we are telling you want 100 no the really important part is if you're familiar with ansible you'll know we need this inventory in which the tool is going to look to find certain things what I've done here has given the plug-in with non your top plugins inventory don't simple dot sample inventory and then the options these are the kind of crucial parts these are the paths to where that your files are so I could say we need a horse fail it could fail and you can have a default fail I've not included that come try to keep it as streamlined as simple as possible but you can also do that as well so the horse fail I'm saying at Levis and home IPV zero normal host or animal I'll show you that a configuration next below that look at the grips fail again the same path home IP V zero and Anya clip story animal and I did have that but if it's tilted that should to keep this simple are just now so what does if I go back at this and I show you the path to the horse felt you like to see if that's the directory I'm in this is the actual path i'm at home i pv 0 non-linear and my cats hosts okay so this is basically the topology which I've got here see these devices one two three four five six seven eight and all I've done is I've tasted an SSH connection with the username John and the password Cisco so all I've done here is of that again we are llamo you're free hyphens here then I've done are one a cool in here and then we just got hostname that's one as the foster faces the IP address of one 192 168 1 5 3 2 11 platform is iOS not just less normal order is going to be a interaction with a Cisco device same thing with a napalm Annette Michael you remember that username as John the password as cisco and the Grippit belongs to a successful group that's gonna be my good up off Cisco devices okay no next one are to the exact same configuration except the IP address is the phone and that's just continues on okay so it's pretty much the same thing all the way down here okay so I can say I'm going to put all these configurations on my github page if you were to copy and paste them and then maybe change a user name and whatnot you can get short and just play around with them so if I do MLS the next one are you sure you as the grip is not llamo actually I'll do okay so this is the last thing we need like I said that's just cool grip again are free hydrants for llamo and then as ESCO underscore grip and I'm just in the platform or using it as iOS okay so that's just the three main fails we need config fail one their hosts and our groups and with that we can get normally or up and running and first thing I what I see is I've had two problems what's normal and the really simple fixes but just in case you may be running the same thing I'm just gonna highlight them the first one as I think it's because a lot of the demonstrations I've seen on normal are for the older one Python 2.7 if you download that no which I did oh what a month ago so and it's gonna be in the new version which is Python 3 so when you're actually executing normal commands a lot of people you may see and the documentation is Python and then type n like normally or slapped or otherwise ok and you're gonna see this it's just not going to find it because using Python 3 be sure to be running Python 3 on the command ok the second thing which I want to impress upon you as well as I'm going to show you these scripts so the Fosters collapse as or nano Nam near stripped one so very often you see and a lot the documentation as you see from norm your doc or no no no quote I don't know if that was what what on previous version anything best to get that but effectively the way effects that I did not have inaudible but just from norm near okay because easy I used to have you know I like it's not sure you the thing you'll get that is what you see a lot the documentation now if I tried it on not just now and I do Python 3 and norm your script one you're gonna get that set up okay cannot import the name and that nor Nia okay so that's the issue they also if you get that what you want to be doing as the nondescript one and change less okay just in omnia and then we'll save that and then it'll run so watch it actually discussed the two scallops first and then we'll run them and then I'll close the video off so the first one as like to say no no no no that one and it's quite a simple one it's pretty much using the one which is on the the nominee of page here it's just that's one really okay so like it's your more some things okay so the first thing you see is napalm get if you watch my napalm that you perceive that normal is actually integrating with napalm it's important to napalm and get so what it's doing it still nor near em in our is the available kitten what do in that Nam near which is what we've imported the configuration fail as config yeah more that's going in match up what that's here we're pretty much tail nor Mia we're a configuration failures okay mmm convict just so nany on laws all the configuration settings it needs so if we go back into the steps so that's the configuration failed dryer on equals true and the results equals normal run and what we're going to is use the napalm get which we've imported and the Gators is pretty much what we want to actually get get out our faces and get facts no I just want to show you how you can maybe make change to their CT Google and find us page on the Napalm website it's just basically palm Network driver get a member for my new pal buddy I went through this again these are all the things which you can change know when you're doing this with Nam neo just as our sample you've little relative fall or see rather than take the world get just use the actual what what you see so see for example here just want you to get environment okay when you put it in the script in here just use the water environment because we're actually using the new pump gets when it understand that already so in the case here fat what that is actually getting is this one here see this one here get facts but when we tape empty the normally I just use fact we don't take get same again here no I'm getting his interfaces but actually call him this one get Emma faces here okay so say for example we wanted to get the ARP table okay will nicely going to take get up table we're just gonna put an up on the score table and I'll demonstrate that just giving you a little bit of information on that in case you won't have about flexibility in change the actual stepped a little bit to get different types of information so that's the first one okay in the second one is the one which I'm cleared into your clock like I see our salt from house video I'm not claiming any clear on this I just wanna show you exactly it's really really good and if we nano and I made that a little bit different because the one he had like I see had they're from normal core and I've also had this little introduction scrap to see a welcome in Don Neil and just how it users connect to where some coloration and all its going to do is like I say it's likely using net and we call this famous and agreeing with Nittany code to get the same command to actually send the commands which are going to tape into it so effectively what it's going to do is give you a little welcome script welcoming normally oh that's the dynamics do it please the only command you wish to execute separated by commas and what Nonna's going to do it is just going to show these commands with parallelization and then pull them all back in so you'll notice a real real performance improvement from where I was doing this on just make me go alone okay so that's pretty much the outline of the what we're going to do and why she kept on and do it then so LS and if we do Python three okay and we do general I'll just clear us just make sure like an SSH until these first John one name - 1 6 8 1 5 feet 11 Cisco yep I can take that on past although yeah that so this interface orders orders from the scriptlance of python 3 non your slapped one and we're going to get fat and from and our face information kit just run that mm-hmm there we go that's all that done there so you can see we've got the fax that says it's all the facts there and it's got yours the key for that and social faces one there so I'll get a my face information and I forgot pls it's got all the the faces so our five there's the facts there's an office information right there and you'll notice how much trackabout was then just running and napalm on it's the one okay this is so much faster it does all at once with concurrency so you flick it out all that information really really quickly so that's the first script link is there and next one I'll show you this is the one which in just got the interactive one which a copy from Stuart Clark so if I do a Python three and a non you change the date through this one wasn't all complete okay so anyway Python three and nondescript so and what we're gonna do is have that welcome welcome in Narnia that's the dynamics check please gently command us to execute separated by commas example sure IPR face brief sure I Peter Chilvers and so what it's do that the show IP and brief or maybe two is sure IP routes um I would say I'm just doing a short on as well okay and just pack up and no one is going to go and grab all these let's go just execute the second so concurrently wedding dead the first command there's the second one and then the short on at the end there we go so that's everything there and you'll see how fast that really was and like I said when it comes to actually that's all you're sure runs say rotates sevens right up and like I say that scale so well if you just gone by the benchmark which I was looking at you can do that's on ten thousand devices and it's going to be really really fast so that's is why I'm trying to see nor Neil is a great great tool to be Lealman you get out all the information like I say just like that in the previous video with them and they Palmer believe you can do these things whereby F with the say for example I won't even do that one I'll change most make sure he was the second one a nano and all the norm your scripts one okay so like I said just wise to show you how to do it so say for example we wanted to check the change information and like I said we wanted to get the say for example the get up table all we're gonna do is take the get on the score out there and just take that's part of the up on the score table so the way to add that as if we're just go in here and put a little comma there and we do up on the score table and enclose that and if we just save that know if you're not again Python 3 and doun on your script 1 we're also going to get that additional information there we go my cellphone so you see look at then our faces they're the facts blacks are there and up table isn't there as well and that's true for all the rules that's really it's there this is seven again our tables here four facts here and like I say that's true for all of the debates that's went get up them all they're really really fast so what I'm going to do is the last thing as justice that we tapped like I said if we do em Python 3 normally or script 1 what I like to do it's just paint that open straight that takes the element we call output text because when you do that it's obviously saved and I like to use this little clip towards the clip through even though it does do a lot about highlighting I do think it does help a little bit as well okay so if we throw an alias and we can't the crypto that's the one here okay and I'll also put us and the and they get help as well so let's do there and we put texts you know be just get a national back off a high latent so you can just see easily which wristwatch that's really it that's a seven row sex so on and so forth yep so that's pretty much the end of the introduction to non meal like I say I'm not going to do too much honor the next one were actually gonna be looking at pushing that configuration fails that's just an introduction to get you set up hope you do some basic a get some information the devices your show commands and stuff like that so that's pretty much it so like I say I'll put the github link in the description I'll have all the configuration you want to download them like you see it be aware of Python 3 not Python and that not important or not normally or core be aware there was two things that's quite important so that's the end of video I think the next on today we'll be back on the ccmp sweat CDs and then after that I'm going to another one on normaly of actually getting info conditions from text files ok so thanks very much and I'll see you guys soon bye bye
Info
Channel: IPvZero
Views: 9,561
Rating: undefined out of 5
Keywords: nornir, nornir network automation, nornir python, nornir python examples, nornir python automation, python network, IPvZero, ip zero
Id: NntWc-VsmZA
Channel Id: undefined
Length: 19min 45sec (1185 seconds)
Published: Sun Dec 29 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.