Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 249166

Re: Use vdiskcreate.pl for "Thin" vmdk

$
0
0

When looking for why my vDiskCreate was failing, I searched high and low and this post was the closest I found to the answer. It pointed me to the following section:

 

Okay, onto your question. So there's actually 2 places you need to make edits. If you've ever looked in any of these vSphere SDK for Perl scripts, you'll notice by default VMware has written a few Perl Modules that are contain useful utility functions that live in /usr/lib/vmware-vcli/apps/AppUtil, one of which that needs to be modified for this change is VMUtil.pm.

.........

 

While editing this script, I realized VMware had a bug which caused an error and after few minutes of digging around, I realized that when they search for the SCSI controller, they're keying off of "SCSI Controller" though this fails, at least in vSphere the syntax is actually "SCSI controller", the C is lower case and not capital.

So I went about digging into VMUtil.pm and found that for some unknown reason, the patch to the bug that lamw found, was to hard code looking for a "VirtualLsiLogicController".... Now we all know there are multiple types of virtual scsi controllers... and I just downloaded a fresh copy of the Perl SDK for 5.1... so this is a really rather odd find. In the vsphere 5.0 documentation I found the below stating there are at least 4 kinds.

Data Object - VirtualSCSIController

Extended by
ParaVirtualSCSIController, VirtualBusLogicController, VirtualLsiLogicController, VirtualLsiLogicSASController

I edited the if statement on line VMUtil.pm::line 396 to include an or statement so that it will read the ParaVirtualSCSIController that my company uses in newer VMs.

 

# This subroutine finds the scsi contoller on virtual machine
# Input Parameters:
# ----------------
# vm:                   Managed Object of virtual machine.
#
# Output: Returns the device data object, if found.
sub find_scsi_controller_device {
   my %args = @_;
   my $vm = $args{vm};
   my $devices = $vm->config->hardware->device;
   foreach my $device (@$devices) {
      my $class = ref $device;
########EDITED By James Anderton to add Class ParaVirtualSCSIController on 2/24/2013
      if($class->isa('VirtualLsiLogicController') || $class->isa('ParaVirtualSCSIController')) {
         return $device;
      }
   }
   return undef;
}

 

 

If I am mistaken and this is fixed somewhere I appologize, but otherwise this really needs to be updated by somebody with authority because I lost hours searching the interwebs for this one and I am sure more others just tried, failed and gave up rather than bother recoding a library.


Viewing all articles
Browse latest Browse all 249166

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>