VMware Communities > Developer Community > VI Toolkit (For Windows) > Discussions

This Question is Answered

1 2 3 Previous Next
31 Replies Last post: Aug 7, 2008 5:42 AM by hmundt
Reply

Call for script ideas

Feb 18, 2008 4:39 PM

Click to view halr9000's profile Expert halr9000 424 posts since
Jun 7, 2007
Have any ideas for VI-TK scripts you would like to see written? I need some ideas for a little project I'm working on. Right now I'm going to go troll the Perl toolkit forum. ;)
Reply Re: Call for script ideas Mar 3, 2008 11:53 PM
Click to view LucD's profile Expert LucD 421 posts since
Oct 31, 2005
Something we are currently looking at:
  • create a number of guests based on an external config file (.CSV) that contains: hostname, OS-type, mem & disk-size, vswitch, IP address...
  • the guests have to be created from existing templates with customization parameters taken from the file above (hostname, IP address...)

The customization is currently giving us problems (see my set-OSCustomizationSpec & IP address post).
Using Carter's method to make VI SDK calls seems to be the way out.

Mission impossible or feasible ?
Reply Re: Call for script ideas Mar 4, 2008 10:48 AM
in response to: LucD
Click to view halr9000's profile Expert halr9000 424 posts since
Jun 7, 2007
I'll look into this in detail soon. Some of this may be addressed in the open beta revision. The rest (like this new bug you found) I believe can be handled by the VI SDK or other means. From my research so far things QUICKLY get hairy, at least in my terms, from a sysadmin POV. I imagine some developers may not see it the same way. :)

Also FYI, there are a few other ideas on my blog: http://halr9000.com/article/464

Keep the ideas coming. :)
Reply Re: Call for script ideas Mar 12, 2008 9:25 AM
in response to: halr9000
Click to view halr9000's profile Expert halr9000 424 posts since
Jun 7, 2007
So my project is public now! I'm working on "Managing VMWare with Windows PowerShell: TFM®". So LucD, some form of your request is going to be a part of my book. I can't promise it'll get done in time for it to be of any use to you personally though, but I'll try.

I'm very excited, this is the first book I've ever tried writing a book. In fact, I don't think I've written anything longer than a few pages before. :)

At some point down the road I'll need technical reviewers, I may ask for volunteers then if anybody's interested.
Reply Re: Call for script ideas Mar 24, 2008 6:48 AM
in response to: halr9000
Click to view JDLangdon's profile Expert JDLangdon 659 posts since
Jun 30, 2006
halr9000 wrote:So my project is public now! I'm working on "Managing VMWare with Windows PowerShell: TFM®". So LucD, some form of your request is going to be a part of my book. I can't promise it'll get done in time for it to be of any use to you personally though, but I'll try.

This is one book that will be on my must read list. :-)

Jason
Reply Re: Call for script ideas Mar 24, 2008 8:16 AM
Click to view bottledair's profile Novice bottledair 5 posts since
Mar 19, 2008

Good luck with the book. It something greatly needed. Here are a couple of ideas.

1. Look for unused datastores. If you have setup a small datastores or one to one relationship(vm to datastore) as machines get moved or deleted this can leave a datastores unused. Have a script that will go through the datastores and find any that do not have currently any vm's attached. This allows for quick and easy tracking and recoupe of san space.

2. Look at the datastores and virtual center and find any virtual machine files for machines that may have been removed from inventory but, not deleted.

Reply Re: Call for script ideas Mar 24, 2008 8:25 AM
in response to: bottledair
Click to view halr9000's profile Expert halr9000 424 posts since
Jun 7, 2007
Thanks, both of you. And thanks bottledair for the ideas, much appreciated.

Hal Rottenberg
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Reply Re: Call for script ideas Mar 25, 2008 6:23 AM
in response to: halr9000
Click to view dsanders's profile Expert dsanders 516 posts since
Mar 2, 2005
Something I am beginning to work on, and should be fairly simple, is the ability to schedule the migration of virtual machines. I do not have SAN storage yet so vmotion is not an option. So if I want to move virtual machines off of a host I usually end up having to wake up during our maintenance window (4 - 6 am), power off the machine, migrate, wait and then power up. It is an easy job. I just don't like waking up at 4 am :)
Reply Re: Call for script ideas Mar 25, 2008 7:24 AM
in response to: dsanders
Click to view Chris_S_UK's profile Expert Chris_S_UK 583 posts since
Feb 20, 2006
can't you use a scheduled tasks (or rather 3 tasks - shutdown/move/power on) to do that?
Reply Re: Call for script ideas Mar 25, 2008 7:48 AM
in response to: Chris_S_UK
Click to view halr9000's profile Expert halr9000 424 posts since
Jun 7, 2007
You might be able to do some of it, but the tasks which you can schedule in VC are fairly limited. I'm told you can schedule anything by using the SDK, and hence, the VI toolkit. I already have on my todo to see how easy/difficult it will be to schedule arbitrary tasks using powershell.

Hal Rottenberg
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Reply Re: Call for script ideas Mar 25, 2008 9:13 AM
in response to: halr9000
Click to view adias's profile Enthusiast adias 43 posts since
Jan 9, 2008
VMware
There are of course alternatives to the VC scheduler. For example, the Windows scheduler. Sort of depends on your requirements.
Reply Re: Call for script ideas Mar 26, 2008 1:48 PM
Click to view David Ank's profile Enthusiast David Ank 19 posts since
Oct 22, 2007

As you all know its possible to set vm swap files into different datastore.

Therefore, maybe a script that would be able to tell the location of vms files?

Furthermore, maybe if the stores which they located on are NFS or ISCSI.


David

Reply Re: Call for script ideas Mar 26, 2008 3:09 PM
in response to: David Ank
Click to view erickmiller's profile Enthusiast erickmiller 67 posts since
Sep 29, 2003

This is probably pretty simple to do in PowerShell (now that I've had a little time to play with it), but a list of Folders or Resource Pools (and Sub-Resource Pools) with a respective count of powered on/off and suspended VMs would be nice. Possibly an option to break down the counts by host. Next would be disk utilization (free/used/total space) for these same categories.

I suspect we'll end up capturing a lot of the required information into an SQL Server database and use SQL to provide us with all of this, but it would be interesting to see if it's possible (and easy) to do it in PowerShell.

We run a high-availability hosting company that leases resource pools with the ability for customers to create as many virtual machines as they want within their allocated resources (disk space is the limiting factor). I'm just thinking of quick commands that we could use to find problem areas.

Eric K. Miller, Genesis Hosting Solutions, LLC
http://www.genesishosting.com/ - Lease part of our ESX cluster!

Reply Re: Call for script ideas Apr 2, 2008 9:47 AM
Click to view rmontyq's profile Novice rmontyq 13 posts since
May 11, 2005

Mornin':

I am working on learning PowerShell so I can better manage our VI environment. One of the very first things I am attempting to do is to document VI. Where are all the vm's, what is their configuration info (OS, Memory,# & type of disks), what storage each disk is on, etc, etc. PowerShell & VITK provides much of this as individual scriplets, but I want to provide a daily report on the structure.

My 2 cents! And btw, I bought Windows PowerShell v2.0: TFM (2rd Edition) the other day and so far it is excellent... will plan on adding yours as soon as it is out and would love to preview any chapters, scripts, bring you coffee, whatever, to get a peek at it!

Thanks!

Reply Re: Call for script ideas Apr 2, 2008 10:03 AM
in response to: rmontyq
Click to view halr9000's profile Expert halr9000 424 posts since
Jun 7, 2007
Yes, a daily report sounds good. Noted. And BTW, I'm not the author of that TFM book, that's Don Jones, whom I greatly respect. :)

Hal Rottenberg
Co-Host, PowerScripting Podcast (http://powerscripting.net)
1 2 3 Previous Next
Actions