Several times i had the need to synchronise Virtual Machine notes (vmware) with Active Directory Computer description. As in big environment, different team are managing each of these components, the need to be able to link an Active Directory computer account to a vm with XenApp / XenDesktop delivery group has often been seen as useful. Delivery group name : Desktop123 Virtual Machine note (vmware) : Desktop123 Active Directory account Description : Desktop123 The idea is to simply synchronise the information through the platforms so everyone knows quickly what machine does what. In this particular example that was about XenApp Servers and XenDesktop VDI. You will need a machine where : XenDesktop 7.x SDK (Powershell is installed) vmware PowerCli installed RSAT role deployed as well Thank to Rodolphe Herpeux who simplified the first version of this script I wrote.
This is a classic but needs to be written somewhere so I can find it again when I need it ! First thing, you need to add the XenApp Powershell snapin : Then you can use few very useful command to gather information and script your deployment / inventory. That's what you got access to, now I want to list hotfixes on XenApp servers, I used Get-XaServerHotfix "ServerName" The result format is not very useful and is about only 1 server in a farm of 100... And I was looking for all the servers which had the XA650R01W2K8R2X64061 hotfix installed I needed to have a list of all servers, only the machine name where this hotfix was installed. And the result look like this : This is simple and quite basic but it's very useful ! if you have any comment and/ or request, just drop me an email or comment !
WP-XenServerStats - Wordpress Plugin for XenServer 1/2 WP-XenServerStats - Wordpress Plugin for XenServer 2/2 In the first part of this blog, I made a list about what I wanted to do, how to get the data and how to transport it from my XenServer (home) to my Web Host (Datacenter). Now I'll explain how I create one Wordpress plug-in (my first one) to show everything : It looks good, and even if it's really low level on the dev side in PHP and scripting, it works well. In Wordpress, there is this sidebar, on the right, if you want to add something you can chose to do it as widget, it's clean and not hard coded in the main Wordpress code, then you can easily keep this plug-in and keep it working without changing anything from a theme to another. I created a file named : wp-xenserverstats.php in a new directory : http://www.domainname.com/wp-content/plugins/wp-xenserverstats/wp-xenserverstats.php this is the main plug-in file and as you can read bellow, this is very very basic. So as you see, there is still some hard coded path... I try to get rid of that this week, and if someone can give me the tip, it will save me some time... I think you have everything to try to make it work on your side with some change. Of course if you want the information refresh automatically on your blog you need to setup a cron, I chose hourly for me, to run the script describe in the first part of this blog. You can download a zip file containing the plug-in directory with the bash script to gather all the data on your XenServer here : For some of you more skilled than me, maybe you would like to help, you can send me your modification or post comment here, I'll modify the blog entries or create a new blog if needed :) Here is the list about things I want to do to make this plugin easy to setup and use : Export all data in MySQL instead of files Use path variable for everything Adding more information : XenServer host version, Disk usage, Network usage, Memory usage Adding a graphic performance for the host and for each VMs I hope some of you will test that out and share the www their XenServer stats !
WP-XenServerStats - Wordpress Plugin for XenServer 1/2 WP-XenServerStats - Wordpress Plugin for XenServer 2/2 I got this idea when I saw Nick (Show And Tell : First vSphere Plugin for WordPress!) doing something I wanted to do for Citrix XenServer. Then before trying to do myself (I'm a very bad dev....) I've try to find someone who did it better than I would ever do... And no one did it(yet)... So here I am trying to make something nice and learning again something new (php / mysql / function etc...) just to show off my XenServer @ Home hypervisor stats. I got everything working, but I'm sure someone, better dev than me would make a really cleaner and efficient job. I've study Citrix XenServer 5.6 FP1 SDK documentation / references and this is hard (for me) to try to find a good way to handle and find values I'm looking for. So my first step was to list everything I wanted to see on my widget bar (the bar on the right on this blog) Here is the list : Show Hostname Show Number of CPU Show Memory amount Show Number of VMs Show Number of VMs On Show Number of VMs Off Show Number of VMs Paused Show Last data refresh update time Automatic information refresh every hour Storing these data in my MySQL database At first I needed to find a mechanism to get all those data the simplest way possible. As I told you, I'm not very comfortable yet with MySQL stuffs, so I'll do it the old way because there is really not much data and I think this is a good start. To get the amount of VMs running on my host it came very quicky a simple way to get it : And then using the same way, it was be very easy to get the Powered, Halted and Suspended ones : As you might have understand I'm listing VM with their status and I'm using the grep -c option to count the number of line in the result. Why I'm doing it that way ? Because I already know how to read a value from a text file in php and I won't burst my mind yet to try something else. If I'm able to transport this information from my XenServer to my Web Host, I'll be able to display it. I'm still…