29 October, 2009

CentOS 5.4 support

Leong, a really solid guy at VMware, has a post up describing how to add a build profile for CentOS/Red Hat 5.4, here:

http://blogs.vmware.com/vapp/2009/09/vmware-studio-adding-rhel-54-support-in-minutes.html

08 October, 2009

Studio2 Suicide After Reboot

If you have to reboot the Studio2 appliance it will lose its OS image ISO internal loopback mounts. Upon losing them it will not simply try to remount them, instead it will try to download the image again but will save it with an indexed extension over and over until your Studio2 disk is full.

There are two fixes involved. The first simply attempts to remount the ISO. The second deletes the ISO (fragment?) before attempting to redownload the same image.

Here's the patch:


root@vmstudio:/opt/vmware/lib/build/VADK# diff -u /opt/vmware/lib/build/VADK/bkp/ISO.pm /opt/vmware/lib/build/VADK/ISO.pm
--- /opt/vmware/lib/build/VADK/bkp/ISO.pm 2009-10-08 10:20:37.000000000 +0000
+++ /opt/vmware/lib/build/VADK/ISO.pm 2009-10-08 13:23:59.000000000 +0000
@@ -77,6 +77,12 @@
#
my $already_mounted = `mount | cut -f3 -d' ' | fgrep $mountpoint`;

+# Will: simply remount it if possible
+if (!$already_mounted && (-f $filename)) {
+ &mount($filename, $mountpoint);
+ $already_mounted = `mount | cut -f3 -d' ' | fgrep $mountpoint`;
+}
+
if (!$already_mounted) {

if ($iso =~ /^(ht|f)tp:(.+)$/i) {
@@ -90,7 +96,12 @@
if (-r $envFile) {
$wgetcmd = ". $envFile; ";
}
- $wgetcmd .= 'cd '.$stageDir.'; wget '.VADK::Constants::WGET_TIMEOUT.' '.$iso;
+
+# Will: fix re-download attempts (were saving with .index extension)
+unlink($filename);
+$wgetcmd .= 'cd '.$stageDir.'; wget'.$iso;
+
+ # $wgetcmd .= 'cd '.$stageDir.'; wget '.VADK::Constants::WGET_TIMEOUT.' '.$iso;

my $ret = VADK::System::systemWrapped($wgetcmd);
if ($ret->{'exit_value'}) {


I also stripped out the retry and timeout arguments to wget as they were causing wget to abort on a peer reset instead of continuing with a new connection.

If you've run into this problem do delete all the files in the download ISO cache:

rm -vf /opt/vmware/cache/build/ISO/*