Posts Tagged ‘VMWare’

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.
shrink-vmware-vmdk

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?

(more…)

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.

vmware-disk

(more…)