VMware Virtual Machine shutdown, startup, etc….

So I did some additional testing on the claim that vmware-cmd will not shutdown a VM that is locked at the console and I have not experienced the problem what I did find was the bash scripts that scripts that worked on my ESX 2.x server did not work on my VMware Server machine – it appears that _spaces_ in the directory structure and/or vm file name cause the script to fail.

These are examples of the original scripts:

getstate.sh
#!/bin/bash
echo “Getting running state of VM Guests…”
for vm in `vmware-cmd -l`
do
vmware-cmd “$vm” getstate $vm
done

stopall.sh
#!/bin/bash
echo “Stopping all running VM Guests…”
for vm in `vmware-cmd -l`
do
vmware-cmd “$vm” stop trysoft hard
done

The results on my ESX 2.x server for getstate.sh is the following:
getstate(/home/bocchrj/vmware/rh62_1/linux.vmx) = off
getstate(/home/bocchrj/vmware/rh62_2/linux.vmx) = off


On my VMware Server box this is the output of getstate.sh:
Getting running state of VM Guests…
/usr/bin/vmware-cmd: Could not connect to VM /Virtual_Machines/Windows
  (VMControl error -11: No such virtual machine: The config file /Virtual_Machines/Windows is not registered.
Please register the config file on the server.  For example:
vmware-cmd -s register “/Virtual_Machines/Windows”)
/usr/bin/vmware-cmd: Could not connect to VM XP
  (VMControl error -14: Unexpected response from vmware-authd: Invalid pathname: XP)
/usr/bin/vmware-cmd: Could not connect to VM Professional
  (VMControl error -14: Unexpected response from vmware-authd: Invalid pathname: Professional)
/usr/bin/vmware-cmd: Could not connect to VM SNMP
  (VMControl error -14: Unexpected response from vmware-authd: Invalid pathname: SNMP)
/usr/bin/vmware-cmd: Could not connect to VM Tools/Windows
  (VMControl error -14: Unexpected response from vmware-authd: Invalid pathname: Tools/Windows)
/usr/bin/vmware-cmd: Could not connect to VM XP
  (VMControl error -14: Unexpected response from vmware-authd: Invalid pathname: XP)
/usr/bin/vmware-cmd: Could not connect to VM Professional.vmx
etc…..

I took the time to write a slightly more robust perl script to stop and start VMs that appears to work well on both ESX 2.x and VMware Server (I only tested this on VMware server running on on a Linux host but it should work on a Windows host with perl installed).  If you would like an executable (exe) version for windows Email me and I can provide it to you.

#!/usr/bin/perl -w
#vmpower.pl
#RJB – 1/23/2007

use strict;
my $command;
my $switch;

if ($ARGV[0] eq “help”) {
    &usage;
    }
if ($ARGV[0] eq “getstate” || $ARGV[0] eq “stop” || $ARGV[0] eq “start” || $ARGV[0] eq “reset”) {
    &power;
    }
else{
    &error;
    }

sub power {
$command = “vmware-cmd -l”;
print “==> $command\n”;
if (system(“$command > .vmtmpfile”) == 0) {
  print ” success, exit status = $?\n”;
} else {
  print ” failure, exit status = $?\n”;
}

open (VM, ‘.vmtmpfile’);
while (<VM>) {
chomp;
$command = “vmware-cmd”;
$switch = $ARGV[0];
print “==> $command \”$_\” $ARGV[0]\n”;
system(“$command \”$_\” $switch”);
    if ( $? == 0 ) {
      print ” success, exit status = $?\n”;
    } else {
      print ” failure, exit status = $?\n”;
    }
}
close (VM);
system (“rm -f .vmtmpfile”);
}

sub usage {
system “clear”;
print “VM statup and shutdown script for ESX 2.x and VMware Server\n”;
print “vmpower.pl\n\n”;
print “Usage:  vmpower.pl [getstate|start|stop|reset]\n\n”;
exit;
}

sub error {
    print ” error\n”;
    print ” \”vmpower.pl help\” – for usage instructions\n\n”;
    exit;
}

Shutting down a Windows VM when the console is locked

It was brought to my attention that vmware-cmd can not gracefully shutdown a Windows VM when the console is locked.  Yesterday I spent sometime researching the issue and the guys at Sysinternals once again have coded a quality utility that appears to have solved the problem.  I only hope that they can maintain the same level of quality now that Microsoft has acquired them.

Download psshutdown here

To shutdown a single host the syntax looks like this:
psshutdown \\host -t 5 -f -m “Shutting down in 5 seconds”

To shutdown multiple hosts psshutdown takes input from a file (e.g. – hosts.txt)  where the host names or IP are separated by a .:
psshutdown @hosts.txt -t 5 -f -m “Shutting down in 5 seconds”

To shutdown a single host when not logged in as a privileged user you will need to pass credentials to the the psshutdown command:
psshutdown @hosts.txt -t 5 -f -m “Shutting down in 5 seconds” -u administrator -p password

The standard windows cli shutdown command also works if you use the force option (-f).  The thing I really like about psshutdown is the ability to pass a file with a list of hosts and the ability to pass user credentials.

BackupPC Virtual Appliance

So, I landed in California about 3.5 hours ago and headed out to grab some dinner. Just so happened that I wondered into the kick-off party for “The Real Housewives of Orange County”… Nonetheless I made it back to the hotel after consuming some sushi to get the BackupPC virtual appliance posted to the Files sections. Let me know how the virtual appliance works, the install and configuration instructions are documented in the “Open source backup and data de-duplication virtual appliance”post.

[tags]virtual appliances de-dupe backup recovery backuppc[/tags]

Hacking the Red Train theme

I spent a long time last night reworking my WordPress theme after trying a number of other themes that were either buggy or not very visually appealing.  I think the new look should work well, I was really tired of the red.  Please let me know what you think, there is a poll at the bottom of the page.

Also you may be wondering where to download the BackupPC virtual appliance from, well I have to figure out how I am going to host it.  I should have it up later today or tomorrow.

[tags]wordpress backuppc theme[/tags]

Open source backup and data de-duplication virtual appliance

While I have been a bit quiet lately, I have been working on two new projects one is a BackupPC virtual appliance. An agentless backup and recovery system that also de-duplicates. There is a lot of discussion around technologies like Data Domain, Diligent, EMC/Avamar, and Asigra, this virtual appliance provides similar functionality for FREE. I am also working on a web based UI for this appliance to simplify setup and sync integration for replication.

Setup of the BackupPC virtual appliance is quite simple.

  1. Start the BackupPC Virtual Appliance
  2. The virtual appliance is setup to use bridged networking, it should receive a dhcp address on your network
  3. Log into the BackupPC virtual appliance
    • Username: root
    • Password: backuppc
  4. Identify network IP address
    • ifconfig -a
  5. Open you desktop browser and point it to http://ip_address/cgi-bin/BackupPC_Admin
    • Username: admin
    • Password: password
  6. Create a user “backuppc” on the windows hosts that you want to backup. Backups are performed via SMB so the “backuppc” user should have read access to the C$, etc… shares.
    • Note: Don’t forget to set the users password
  7. vi /b2d_target/conf/config.pl
    • You will need to modify 3 variables in this file
      • $Conf{SmbShareName} = ‘C$’;
        • These are the shares that you want to backup
      • $Conf{SmbShareUserName} = ‘backuppc’;
      • $Conf{SmbSharePasswd} = ‘backuppc’;
        • The SmbShareUserName and SmbSharePasswd should match the username and password that you created on your windows host.
  8. Add hosts to backup.
    • vi /b2d_target/conf/hosts
      • Follow the syntax in the file – the use of IP addresses is OK
  9. Reload the backup configuration file from the web ui
    • Select “Admin Options” and “Reload Config”
  10. You are now ready to start a backup

For detailed usage documentation see: http://backuppc.sourceforge.net/

NOTE: [THIS IS OPTIONAL]

Finally the virtual machine is configured with a 300GB backup target disk (/dev/hdb2). This is Hard Disk 2 (IDE 0:1), if you need more space you should follow the following procedure:

  1. Shutdown the virtual machine
  2. Remove Hard Disk 2 and add a new larger virtual disk – See vmware docs for more detail
  3. Login as root
  4. /etc/init.d/backuppc stop
  5. mkfs -t ext3 /dev/hdb1
  6. mount -a
    • verify that the new device is mounted on /b2d_target
      • df -k
  7. /etc/init.d/backuppc start

Please download and try this virtual machine, and let me know if you find any issues with the documentation. Enjoy!

[tags]virtual appliance backup recovery backuppc linux vmware windows agentless[/tags]

Pondering the future of tape…

The other day I was asked to comment on a few question with regard to the future of tape technology.  I thought the questions were good one so I though I would post my unedited responses.

Question:

Many analysts and storage observers have said that tape is becoming obsolete, yet I have spoken to Sun Microsystems and IBM and they both say that using tape for storage is fundamental to their business strategy and that they are experiencing growth in this area.

What are your thoughts about tape?s evolving role in storage and do you think for the longer term tape will survive and still be relevant to storage over the next year, five years or even a decade. What trends are you seeing in tape?s use?

Response:

First thought is 5 or 10 years is a lifetime in technology. While today I believe tape is still and integral part of most IT infrastructures the management, consumables and vaulting costs are prompting many organizations to investigate technologies with the hope of reducing their dependency on traditional tape technology and improving SLAs. Technologies such as virtual tape, data de-duplication and emerging technologies such as removable disk cartridges (e.g. – http://www.prostorsystems.com/products.php) and holographic storage (http://en.wikipedia.org/wiki/Holographic_storage) will change the way we approach backup and recovery.

Obviously IBM and Sun Microsystems (post STK acquisition) have thriving tape businesses that are fundamental to their business model and I would expect them to continue promote and evangelize the value of tape. As a technologist I think that it would be na?ve to assume that in the next 5 to 10 years there will not be game changing technologies that arise that will affect the need for traditional tape.

Question:

Do you use tape for storage? If so can you describe the response customers are giving you to its use? Is your business growing in this area, or is it dwindling?

Response:

Me do use a fair amount of tape but the amount of tape technology is declining due to the deployment of alternative technologies such as Snapshots, Virtual Tape, Content Addressable Storage, data de-duplication and enterprise wide archiving strategies. Our backup and recovery business is growing but the platform is no longer tape only.

Question:

What are the virtues of using tape? I understand that the popularity of virtual tape libraries are on the rise, but in general is tape a better form of storage that disk? What are tape?s advantages and what are the disadvantages?

Response:

This is like debating religion. Obviously today the biggest benefits of tape are portability, density and cost. The biggest drawback is management. Format incompatibility, possible reliability issues for long term retention, vaulting costs, the debate of iron vs. speed, etc?.

Question:

If you have any other thoughts on the use of Tape that my questions don?t address, (such as cost) etc., please feel free to give me your insights.

Response:

Often an overlooked component of tape infrastructure is the vaulting cost. The use of a solid archiving strategy and the use of emerging technologies such as data de-duplication will not only simplify management and improve SLAs but can also reduce Op-Ex dramatically.

Lastly I believe that there are some compelling events that prompt us to investigate technologies that augment the use of tape. These technologies will absolutely erode some of the tape market share. The cheese will move over the next 5 to 10 years, maybe the tape vendors will move it or maybe it will be a new innovator, the market players will react and those who do not will loose market share and may potentially fizzle out.

For more detail on the effects of archiving on the use of backup and recovery see: http://gotitsolutions.org//2006/08/22/the-simple-value-of-archiving.html