Skyline Advisor Pro: Insights API Overview

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone i'm kelsey lemmons and technical marketing manager here at vmware and joining me today is my colleague sunny nguyen senior technical marketing engineer at vmware and we want to welcome you to our vmware skyline advisor pro api and automation session so here's our agenda for today we're going to define what an api is outline its advantages and show how to access the insights api in skyline advisor pro and end with some common use cases on how you can leverage the tool so let's dive right in and define what an api is and what it does chances are that you know that api stands for application programming interface however unless you are one of the relatively few people who has worked hands-on developing apis it's likely that you don't know what an api is in a nutshell an api is both a piece of software running on a network server and a component of programming code apis provide a secure and standardized way for applications to work with each other and they automate the retrieval and even the updating of information without the need to go into a graphical user interface otherwise known as a gui for example your company may have a monitoring tool or process that reports potential environment vulnerabilities and even tracks their recommended fixes and it may be your job to manually search and prioritize these potential issues and then send this data into a ticketing system like jira servicenow or even pagerduty so that your entire team can be aware of what's being remediated while something like this may not be an issue with a small environment that may have a dozen or so items to manually enter think about the productivity sink you'd have if you had a few hundred of them on a full-blown production environment that is operating at scale with an api you can eliminate the manual intervention on your part and send this data directly to these systems and that's when the advantages of the api start to become clear so let's go ahead and talk about that as you can already imagine apis can help increase productivity the scenario that i just described could be developed as an application but if that data is already exposed as an api you wouldn't have to build a new tool from the ground up thereby saving you valuable development time and enabling your company to realize is business goals faster and speaking of the productivity benefits that an api provide by way of helping to automate common tasks there is a monetary component tied to it as well apis can save you money since api significantly reduced the development effort using them to create an application is an effective way in terms of reducing costs with apis developers can fetch most of the data they need to integrate with other systems without the need to start from scratch instead of spending their presses resources and time on reinventing the wheel they can use cost effective apis from third-party providers like vmware and according to one survey developing and deploying an app once effected in time for prototyping going into beta and ultimately delivering and maintaining the app the cost can range anywhere from twenty thousand to a hundred and forty thousand dollars last but not least apis and the automation that they drive can improve connectivity collaboration and communication within a business since api's core functionality is connectivity they enable different systems applications and platforms to connect and share data with one another and perform various types of functions which is essential in today's world where it's estimated that an average company runs about 464 custom applications without apis all these tools and the benefits that they provide would be siloed which reduces their impact on your business's bottom line and the net net of these advantages is that apis and automation help drive innovation through apis businesses can introduce cutting edge technologies with fewer resources adapt to requirements faster like meeting slas and even introduce new ways to grow their business now let's talk about apis and automation in context of skyline advisor pro customers like you have said that they want to do more than just view skylines findings and recommendations they want something that allows them to take action on them so we've provided this ability with our insights api with it you can take skylines finding data and extract it via the api tool into the tooling of your choice to automate whatever you want for example you want to create a ticket out of a finding no problem you want to use configuration automation tools go ahead and code away you want to send all your findings to slack done with the insights api scaling advisor pro can connect teams so whether you're a sys admin an sre or an it manager the insights api can enable all of you to work together automate common workflows and give everyone on your team that very valuable time back to do more meaningful work and with that now i'm going to turn it over to sunny where he's going to walk you through how to access the insights api and skyline advisor pro okay today let's talk about skyline insights api right do read the api documentation that is very important because it spells out everything you need to leverage the insights api but before we do anything else let's let's take a look at our accounts to make sure we have the right settings okay so if you were to click on your name select account alright so now let's take a look at roles make sure you have the skyline api user role because if you don't have that everything else we do afterwards just just doesn't work okay so let's talk about api token next all right as you can see we don't have one so let's create one let's call this guideline api token what you need to highlight is developer okay and you select generate make sure you save this off okay copy that put it somewhere just save it off if you don't unfortunately it will not show up again all right so save that off that is your api token to get into the environment what's next so the way it works is your api token is a alphanumeric that sticks with you for six months it never changed in order to access the skyline insights api environment you need your access token that access token is only limited by a small time frame the time frame could be five minutes it could be ten minutes but ultimately it has a very short life span so that access token is what you access but you don't get the access token from the gui instead you have to actually execute a command to do that so let me show you how it's done okay so i'm going to show you two examples one example is in shell using curl and the second example i'll show you in policy li all right so if we were to take a look at the shell version what you're going to see is it's a curl command hitting the console server and then it's going to be prompted with these configuration and what's very important is that the api token that that you have the alphanumeric that you have it needs to go here okay as soon as you do that when you run the command it will spit out a bigger alphanumeric code this by the way is your access token this is what you use to to get your findings which we will show in the other videos beyond this all right so this is shell script using curl let me show you what it looks like in powershell so once again let me show you same same idea same everything else as you can see right it's still json it's still here's your api token as a body you do the invoke rest api you hit the console server once again and it will spit out your access token all right so if we were to do this there that's your access token we use that and then we incorporate into other places stay tuned there will be more videos on how to leverage this so earlier on we talked about the api user role we've talked about the api token and then lastly we talked about the access token all right so now let's let's let's show this in action right um let's talk about and let's show you what it looks like in graphql let's run the command to get our token right so i'm going to grab that token right so this is graph ql but here's what you need to do if you were to just try to run this it's going to fail it's going to fail miserably right so what you need to do here is you need to put a header in in the header it has to have this and you drop your token in there so if you do that when you run this voila now you have all your findings so far i've shown you many examples of how to set up your account how to access and how to test the environment when in reality i've yet to show you how to do it um via command line right so more or less from beginning to end so here's the opportunity to do that this time around very similar to what we did with the token i'm going to show you an example using shell scripting and then i'll show you using power cli the hope is that you're either in one cable the other and you can still leverage the apis okay with that let's start so first things first let's take a look shall we this time all right as you recall earlier on here's your api token you need to plug yours in this is the console which is going to get your token and this is where you get your data in the past i have not shown you this because all i've shown was was the graph ql now you get to see the whole thing all right so this section as you saw earlier this is how to get the token right and here's the curl command to get everything else as you recall from the graphql presentation here is the section that is needed in order to get the data okay we could add a lot more in here but but for this example that's that's all i want to show you alright so if we were to run this as you can see here's the output it looks very similar to what you saw from graphql i've set it up so that way there's five findings right and then if you read through this in your environment you will see some of the variables some of the settings that you have okay let's show what it looks like in power cli okay so first things first let's take a look at the code if you recall this section over here this has to do with getting your access token here is your api token right here's the console access to get in here is invoke rest method that that's a powershell thing similar to the shell scripting the same data port is still the same right and then what i haven't shown you is um there's a json file and then what i'm going to do just here just as an example is just to write out the output and then put it into an fl format all right so here's the json and as you can see from the original script the shell scripting it has a very similar format right so if we do that there you have it here's the finding and if you read it'll tell you the name it'll tell you the base it'll tell you a lot of stuff and all you have to do is you have to start traversing the structure to find out everything okay now let's take a look at how skyline advisor pro's insights api can help your business increase productivity save money and connect teams apis and automations can help you manage your environments at scale and save you a lot of time often skyline will provide a recommendation that can address potential issues that could impact as many as 30 objects at once and trying to address them individually wouldn't be a productive use of time and here's a very interesting statistic sixty percent of availability and performance errors are caused by misconfigurations automation through scripting could reduce that number significantly so let's jump into skyline and see this workflow in action as you can see skyline has given me 107 recommendations with different levels of severity earlier you heard me say that 60 of availability and performance errors are often caused by misconfigurations and interestingly enough one of skyline's most reported environment findings relate to how ntp is configured so let me do a search and lo and behold i see that my environment is reporting this issue as well it's a critical issue indicating that ntp is not configured across my exi hosts and that the times must be synchronized as well and you know if this issue is not addressed the stability of my environment can be compromised skyline is even telling me the names of the exxi hosts that are impacted and the vcenters where they are located and luckily there's a fix for this there's a kb article that describes exactly what i need to do to self-remediate without opening an sr at vmware and you know you may have seen me show this feature before but i'm going to export these findings into a csv file as it's going to play a major role a little bit later in the demonstration here but what i want you to do is to simply make note of the vcenter names the six exi hosts and the kb number that automatically gets included with this report so i'm working from home today so i'm going to remotely log into my vsphere client i can see the vcenter and the six exi hosts where skyline has detected the potential issue and as you can see ntp isn't configured and the time is set to manual for all of them i've copied over the csv file that i've exported from skyline so that it resides locally this particular machine only has notepad installed which is why the file looks different but the data is exactly the same so another fun part you know here's the script that i'm going to use and i can't take credit for it it was written by one of our many heroes here at vmware sunny and as you can see it's just a few lines of code basically the script has set variables for the vcenter name the exxi host and the kb article that it will pull from that csv file that i exported earlier it will then assign an ip address to the ntp servers start the service and set the time and since the csv file has six objects it's going to do this six times so now i'm just simply going to run the script i can minimize this and focus on higher priorities if i want it but i'm going to keep it open so that you can see what's happening in the background now that the script has been completed i can see that my issue has been resolved i'm going to click on a couple of the hosts here so that you can see that the service is indeed configured and installed and running and the time has been set appropriately and now to confirm i'm going to go back over to skyline and i can see that my issues have dropped i've gone from 107 to 106 issues and now i'm just going to do a search for ntp and i can see that it's been removed as a potential issue from the service as well and as i mentioned before apis and automation can save money now i'm going to turn it over to sunny where he's going to demonstrate how you can use the insights api to automate the deletion of too many snapshots remediate vm configurations and remediate upgrade recommendations okay so this is the installment of our skyline pro insight api earlier on we've talked about getting the findings right now let's talk about okay we've got all that information let's actually do something about it and let's let's remediate the situation okay so in other videos that we've done we normally talk about what skyline recommends one piece is the configuration piece the second is the upgrade piece all right so right now today what we're going to do is we're going to show you three different fixes right one of them is going to be vmware vm based fix which is a configuration fix the other one is a v center fix and an esx fix okay so so let's let's go through it as you can see for this example we've got this vcenter this esx and this vm for this particular vm what you're going to see is it has too many snapshots okay if we were to take a look at this is what it will be which is um here is the kb number and title here's the host here's the vm and once again here's the kb that's a so to see to it okay so now if we take a look at the code all it is is connecting into the vcenter get that vm delete the snapshots and then close out all right so i don't normally do just one code so i do the whole entire thing so what i've done was this so let's take a look at this in action and we are talking about that one right so as you can see that's the vm if we were to click that so as you can see it finishes look at the bottom see that now we take a look at the vm there you have it all the snapshots are gone now let's take a look at the esx right so here's my esx server if you notice right it's not attached to any kind of updates right so if we were to go over here to our update manager okay as you can see we've got non-critical and critical right here are all the updates based on what we've already pulled down right so if we were to take a quick look let's take a look at this what we're going to see is this is a recommendation of the esx upgrade here's my vcenter here is my esx and here is the kiwi article that's tied to it right if we were to take a look at the esx upgrade code it is fairly straightforward what it's going to do is it's going to get the patch set from that patch set it's going to create a whole new baseline including that patch set and then it's going to attach the baseline to the esx and it's going to scan it in the inventory what you're noticing is that it doesn't do the actual upgrade and the point of the matter is is we can set up everything for the customer so the customer can set everything up and then it's up to them to do the extra remediation based on um change windows okay so so if we were to take a look now let me get to here okay so now it's completed so if we take a look we go back there's the new baseline okay that's the new upgrade that we were talking about earlier on if we highlight this it will also explain what was added to it which is the actual baseline itself so what i've done is i've actually named the baseline to match the esx upgrade all right so now if we were to take a quick look at our host and cluster take a look at a host take a look at the upgrade you'll notice that for that particular esx server we added the baseline in there so now the only thing you need to do is put this into mains mode and then of course remediate okay now let's talk about vcenter upgrade as you can see this is running vcenter 767 1 10 000 this is like the first iterations of 6.7 down along the way you're going to be asked to update right so if we were to take a look and here is the kb article right and what it says is upgrade vcenter to six seven okay and then it's gonna say the same thing as you saw the last time here's the vcenter you need to update the vcenter and then here's the article that's tied to it right here's the vcenter upgrade there is no nice way of doing it through rest api there's no nice way of doing it through powershell so you have to do it through p-link okay the trick is to do a mount and to do the install we can do this online by having it download but it ultimately could take a lot longer than you want to so the recommendation from my from myself is download the iso and mount it to your machine if you do that the installation will be much faster so here let's take a quick look okay so as you can see it finished the pre-check install and post check if you take a look now you notice that the number has changed from ten thousand to fifty thousand so that's it so this is just a recap just to show you that as you can see has been disconnected but what i've just shown you was the cleaning up the vm snapshot that's vm configuration base doing the esx upgrade baseline that is the upgrade path for esx and last but not least the upgrade path for vcenter i hope that this gives you an idea of what could be done within the space at a later date we will showcase v-rops horizon nsx and vra all right and finally let's take a look at how the insights api can connect teams and improve collaboration even more by showing you how the tool can be used to extract findings data and send it to commonly used internal communication and ticketing systems like slack jira and pagerduty sonny take it away okay earlier on we discuss on how to access the api how to get the data and convert it to csv now let's talk about where do we send it to right um this trick is sending it to slack but in reality the trick can be sent to servicenow or anywhere else as long as you know the json config that you need as well as the token okay so here's here's my example right so here's my token for slack all right that will then be sent in to um slack using slackbot right if you want to know how to do this kind of stuff look into creating a slack bot and then from there you can actually do everything else okay so what i did was was i grabbed the csv right it doesn't matter if you know you pull it from the website and or you pull it from um the api it's always going to be the same and then i grab the four findings that are unique right so the finding id the main host the host that is affected as well as the kb article right as you can see from here i actually sent it to my channel but if you're going to have your own setup it's going to be your own channel okay and then here's the body and the last but not least here's the invoke command to send it to slack using your account all right so what we have here is we have a few findings here right so we've got the esx upgrade we've got the vm snapshots and we've got the what looks like a vcenter upgrade so what we can do here is so before we start let me do this first right let me put that space in there right so now if we send it here there it is right we can do this again this time we can use another finding here's the second finding being that it's the same you know i can do this as well continue and then let's send a third one so i hope you can see what what uh what i've done you've seen the code you've seen my variables and you've seen what could be done so i'm doing this manually but you can actually automate this as well and you can automate it to send a whole bunch of them all right y'all i've already shown you how to send data or at least the findings over to slack now let me show you how to send it to jira okay like before i'm grabbing the four identities or or entries that um that is important to me right the finding the source host the actual host itself and the kb article so from here what i'm going to do is i'm going to hit my jira right your jira host may be different but this portion will be the same likewise um for the data portion it's mostly the same talk to your jira admins to to identify yours right so it's mostly field project and within the project the key is usually the category or the you know the sections that you normally put your tickets through right there's a summary section there's a description section and then last but not least the issue type section right now if you were to try to get data from um jira you're going to find out that there's going to be hundreds and hundreds of custom fields you can go pretty wild and crazy in that space here's just an example of just the bare minimum to send it in okay so here what you're going to see is the same exact code so what i'm going to do is i'm going to do a you know my code and i'm going to send it to jira and i'm going to use this particular finding all right and there you have it as you can see the id is right there right here is the ticket number one nine six so if we were to take a look now the last one that i scanned was nine one nine five so if i do a refresh now you'll find that there is a 9196 and here's my information this particular finding id here's the server the vcenter here's the host and here's the keeper article all right let's talk about page of duty right chances are if you're looking at my video it means that you know your company's running page of duty but for this example i just want to show you that there's nothing here right so here's my code very similar to jira very similar to slack it comes down to is what you want to send in right so i'm going to send in these four variables that you've seen already right likewise um here is the api location this is for everybody that there's no change the slight difference of course is my particular variables for example the id that i need to send it in the token that i need for my specific account right i just put my email address in there just just to match everything else and last but not least the findings right so so if we were to take a look now what i'm going to do is i'm going to use my script i'm going to send it to page of duty and i'm going to hit this particular finding okay now what you're going to see is that it'll show up here so what i'm going to do is is right away i'm actually going to acknowledge this because if i don't they're going to start calling me like crazy too late they started calling me already anyway so what you're going to see here is for this example is i actually put it right into the title itself right so here's the the name here's the main server which is the nsx manager here's the nsx itself and then there's the dock so if you were to edit this you're gonna see the whole entire um pdf or or kb article that that fixes the problem okay so there you have it setting it to pigeon duty and with that that concludes our session in summary the insights api can help you increase productivity save money and connect teams all of which enables you to drive innovation for your business we hope you found this session informative you
Info
Channel: VMware
Views: 102
Rating: undefined out of 5
Keywords: vmware, Insights API, Skyline Advisor Pro, Kelcey Lemon, Sonny Nguyen, Another One, vCenter, NSX, Horizon, vRealize
Id: TS2KdAwY7DU
Channel Id: undefined
Length: 34min 7sec (2047 seconds)
Published: Thu Dec 09 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.