Archive for the ‘VMWare’ Category

Shrink and Clean Your Virtual Machines

Monday, April 15th, 2013

I’m a rabid advocate of VMWare Workstation (and Server for that matter!). I maintain a separate virtual machine – and sometimes more than one – for each client I’ve worked with over the years. This has many advantages, including the ability to pull an old VM out of the archive for a returning client, the ability to install different versions of the portal to match the client’s configuration, and the capability to run different VPN software on the same host machine at the same time (because each VM maintains its own network stack and VPN software configuration).

But having 10-20 VMs can be a bit painful to keep up-to-date and to keep the file sizes down. While I still haven’t figured out how to apply all Windows Updates via command line, each of my VMs now has a batch file that allows me to compress and optimize disk space for each of the VMs that I have. So, once a month I log into my VMs, run Windows Update, and run the below batch file to shrink things up.

You can download the cleanup.bat file, or just copy/paste from the below code. Basically, the script performs the following activities:

  1. Delete the files in c:\windows\temp
  2. Delete the temporary Windows Update files in c:\ windows\ SoftwareDistribution\ Download\
  3. Delete the IE update files
  4. Run the Disk Cleanup Utility (Note: you need to do a one-time run of the command “cleanmgr /dc /sageset: 1” to set your prefs – see the Microsoft KB Article on the topic.
  5. Empty the recycle bin
  6. Defrag the drives
  7. Run the VMWare drive shrink utility
  8. Shut down the machine

So, do you have any optimizations that you think could be added to this script?


Remotely Reboot Windows – Redux

Friday, October 7th, 2011

Years ago I posted a tip about how to remotely reboot Windows Servers via the command line.

It seems you can teach an old dog (that would be me, hopefully not you) new tricks: Credit yet another rock star in the biz – Aseem Parikh – with this little gem, but you can just run:

shutdown /i

… and you get a dialog box that allows you to add a server that needs to be bounced:

You get most of the options in a UI interface without having to remember all those command-line switches.

No word yet on whether the /f (force) option is applied when using the UI version; it’s tough to test because you usually only need that option in extreme circumstances. From my experience, if the UI version of the utility doesn’t work rebooting a stuck box, the command line isn’t going to work either.

If your portal systems often “hang up” and need to be forcibly rebooted like this, consider this another glowing endorsement of VMWare instead of physical machines :). Yet another advantage of going virtual is that you can remotely reboot a box as reliably as physically pushing the power button on the hardware itself, without actually being there.

Cool Tools 4: VMWare Server

Wednesday, April 7th, 2010

Yes, I’m a VMWare fanboy.  I own stock.  I truly believe in this “cloud computing” thing, but it’s going to be a while – if ever – for large corporations and government to trust someone like Google or Amazon to store their data in the cloud.  In the meantime, the next big trend is for these organizations to host data in their own “cloud” – i.e., virtual servers.  Lately, I’ve been migrating some ALUI clients to WCI via VMWare Server.  That is, rather than upgrading servers in-place, we’re using the opportunity to “go virtual” and install the WebCenter 10gR3 portal stack in the VMWare environment, then migrating data and content from the physical servers to virtual.  This eliminates down-time – you can just cut over the DNS or load balancer whenever the virtual environment is ready to go after the data synch.  I’m sure I’ll have another post on this strategy someday, but today’s post is about the Cool Tool called VMWare Server.

For those not in the know, VMWare Server allows you to create many “Virtual Machines” on 1 or more physical machines, each running Windows (or Linux or whatever operating system you choose).  There are many huge advantages of this, including:

  1. Being able to physically reboot the virtual server without “standing in front of it” (this is huge if you’re a WebCeneter portal administrator who’s never actually seen the servers running the WebCenter Interaction portal, and are tired of asking IT to push the power button if something goes horribly wrong).
  2. Being able to duplicate virtual machines to a dev environment or Disaster Recover (DR) site
  3. Being able to use generic drivers while still having full redundancy (say I have a huge physical machine with 4 HP network cards; I don’t need to install HP drivers and configure Windows to handle all those NICS; the VSphere handles that for me; to the virtual environment I have a single, generic NIC that basically never goes down because there are four physical NICs behind it)
  4. Being able to add and remove resources like CPU and RAM from the virtual systems without touching hardware, and view resource consumption in real-time

It’s this last point that warrants a little attention.  Let’s say we have a massive machine or cluster of machines with 4 quad-core 3GHz CPUs and 80GB of RAM, running 20 Virtual Servers.  Each of those servers would have 4GB of RAM – Windows can’t dynamically allocate memory to grow and shrink the memory in real-time, but if we found one server that’s at 90% RAM and another at 10%, we could shift some RAM from one VM to another after a reboot.

Here’s what’s REALLY cool though:  a 3GHz processor handles 3 billion instructions per second; a quad-core (bear with me on this, it’s not technically accurate) can handle 12 billion.  If this were a physical machine, we could mostly get 3GHz out of it, but because we’re virtual, all virtual machines share the same computing power.  So if your WCI Collaboration server is basically idle while the WCI Publisher server is furiously copying files, you might see performance metrics like this:

That’s right – the publisher server is running at SIX (6) GHz, because multiple physical CPUs/cores are crunching data for the one virtual CPU.  Meanwhile, the “idle” server is still doing its job, but handling its load at only 500 MHz:

Ah, techmology…

Cool Tools 3: Parted Magic (and VMWare Workstation)

Friday, March 5th, 2010

Get ready for a handful of VMWare fanboy posts.  I’ve been using VMWare Workstation for years so that I can run different versions of the WCI portal for different clients, and am starting to get involved with VMWare Server (vSphere) for virtual WCI portal installations, so look for a couple of posts on that in the future.

I’ve got about a dozen clients with different portal versions, databases, development environments, VPNs, etc.  And it simply isn’t all that practical to install off these pieces of software (especially VPN software from different vendors, which often don’t play nice with each other) on the same machine.  So for each client and development environment I have, I maintain a separate Virtual Machine.  This way, I can have an installed version of the portal, database, and dev environment that matches the client, as well as the client-specific VPN and any other support files I need.  These Virtual Machines are then portable between my desktop and laptop, and can even be shared with the clients themselves if they need a ready-made development environment: the .vmdk files (which are physical files on your drive that represent the virtual drive in the client Operating System) can simply be copied and shared.

What happens if you run out of disk space on your Virtual Drive, though?  It’s actually not a completely simple process, but can be done in 3 pretty quick steps:

1) Resize the “physical” disk itself. 

You do this by editing the Virtual Machine settings, clicking the hard drive, then clicking “Utilities”, and “Expand” to increase the size.