• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Yellow Bricks

by Duncan Epping

  • Home
  • Unexplored Territory Podcast
  • HA Deepdive
  • ESXTOP
  • Stickers/Shirts
  • Privacy Policy
  • About
  • Show Search
Hide Search

Zero-out all vm’s from just one script!

Duncan Epping · Dec 12, 2008 ·

I’ve been thinking for a while about this. How can I zero-out all my vm’s with just one schedule. I don’t want to manually add a schedule every single time I roll out a VM, I want a central point for administering this.

Today I noticed the blog on using the VIX API. The VIX API can be used for all sorts of things, including copying files to all your VM’s or installing MSI on your VM’s. (Check the blog article for a complete list of supported operations for the VMRUN command.)

If you can install MSI’s then you can also run a simple vbs script:

vmrun -T virtualcenter01 -h https://virtualcenter01.yellow-bricks.local/sdk -u root -p yell0wbricks -gu user -gp userpw runProgramInGuest "[storage1] Windows/Windows.vmx" c:\windows\system32\sdelfrag.vbs

Unfortunately I wasn’t able to test it myself, but it should work just fine. If anyone is able to test it please let me know.

Thanks Carter!

Related

Desktop, Management & Automation, Server Scripting

Reader Interactions

Comments

  1. Carter Shanklin says

    12 December, 2008 at 07:48

    runScriptInGuest requires two arguments, a script interpreter as well as the script. For running a VBS in Windows you can just use runProgramInGuest.

  2. A. Mikkelsen says

    12 December, 2008 at 20:39

    Hi,
    You might for future referance remember to remove your pwd from the script 😉
    But thanks for the idear, I was looking for something lige that, and your post gave me just the input i needed.

    A. Mikkelsen

  3. Duncan Epping says

    12 December, 2008 at 21:28

    that’s not my password 🙂

  4. Cody Bunch says

    16 December, 2008 at 17:42

    I’ve been doing quite a bit of work in VIX as well. Zeroing out is just one of the many, many cool things you can do http://professionalvmware.com/category/vix/

  5. Xavier says

    13 February, 2009 at 19:21

    The tittle of your post says “all vms” but the command specifies only 1 vm (windows.vmx). Am I misunderstanding it?

  6. Duncan says

    14 February, 2009 at 10:36

    yes it’s just an example of how to run a script inside a VM from the outside. You would still need to create a loop or just use the line an x amount of times.

Primary Sidebar

About the Author

Duncan Epping is a Chief Technologist and Distinguished Engineering Architect at Broadcom. Besides writing on Yellow-Bricks, Duncan is the co-author of the vSAN Deep Dive and the vSphere Clustering Deep Dive book series. Duncan is also the host of the Unexplored Territory Podcast.

Follow Us

  • X
  • Spotify
  • RSS Feed
  • LinkedIn

Recommended Book(s)

Advertisements




Copyright Yellow-Bricks.com © 2025 · Log in