Collecting system information with SYDI

I have been using SYDI for quite a while now. The 2.0 release of sydi-server has added some nice features, the ability to generate Word output from .xml files is huge. The only think that I found to be annoying is that the sydi-transform.vbs script does allow the input of an entire directory.

cscript.exe sydi-transform.vbs -xServer.xml -sServerhtml.xsl -oServer.html

This can make the transformation process from .xml to .html fairly labor intensive for a large environment. This little script solves that problem.

#!/usr/bin/perl -w

# syntax: perl transform.pl dir_where_xml_files_live
# e.g. – perl transform.pl ./xmlfiles
# Will walk the file system and output filename.xml.html for each .xml file
#
# Edit these variables to match the location on your system
$pathtotransform=”g:/sydi/tools/sydi-transform.vbs”;
$pathtoxsl=”g:/sydi/xml/serverhtml.xsl”;

#DO NOT EDIT BELOW THIS LINE
$dirtoget=”$ARGV[0]”;

opendir(IMD, $dirtoget) || die(“Cannot open directory”);
@thefiles= readdir(IMD);
closedir(IMD);

foreach $f (@thefiles)
{
unless ( ($f eq “.”) || ($f eq “..”) )
{
system “cscript $pathtotransform -x$f -s$pathtoxsl -o$dirtoget\/$f.html”;
}
}

I’m here…

It has been a few weeks since my last post. I have been really busy kicking off a new initiative and working on a number of other projects. I am knee deep in a VMware replication whitepaper which is slow going just because of all the documentation and my home lab just is not really equipped enough to handle all the things I want to try and document. In my next few posts I will provide some of details that will eventually be found in the complete whitepaper. Anyway, just wanted to let everyone know I am still alive.

Eccentric (aka – The Panther) ////

Could possible be one of the funniest things I have ever seen on network TV!  Is this guy for real or does he have a severe mental handicap?

You can download the video here

The video is an .flv you will need a flash player.  If you need an multimedia player that supports .flv I suggest VLC meida player (VideoLAN Client) alternatively you can download a standalone FLV Player from here.

Is the CAS game changing?

I have been quite for a while, but I have been working behind the scenes on some pretty cool stuff which should him my blog in the coming weeks.  Some good videos and a white paper or two.  In the meantime, I thought I would offer up some conjecture on the HDS’s acquisition of Archivas.

On February 6th, 2007 HDS (Hitachi Data Systems) announced plans to acquire Archivas, a move which could potentially change CAS (Content Addressable Storage) game.  To date EMC with the Centera platform has run away from the archiving pack with an API and platform based CAS (Content Addressable Storage) approach that they acquired from Belgium based Filepool for $50 million in April 2001.  Long-term archiving is more mainstream than every before and the open Archivas ArC solution may be well suited for integration into the HDS TagmaStor (read more about TagmaStor) as a feature rather than an independent platform.  EMC announced a while ago tiered storage in the same frame by leveraging Fibre Channel and LC-FC (Low Cost Fibre Channel) drives in the DMX platform.  The acquisition of Archivas may provide the ability for HDS to integrate CAS into thier mainstream Thunder and Lightning storage platforms.

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.