VMware Cloud Community
billdossett
Hot Shot
Hot Shot

vmclone.pl customization error

Hi,

fairly new to using the perl sdk...  I am trying to deply from a template using vmclone.pl.  It works fine when I don't customize the vm or guest, but when I do I get the following failure when running in verbose mode:

Fault
SOAP Fault:
-----------
Fault string: Cannot complete customization.
Fault detail: CustomizationFault
REQUEST: $VAR1 = '<?xml version="1.0" encoding="UTF-8"?>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
<Logout xmlns="urn:vim25"><_this type="SessionManager">SessionManager</_this>
</Logout></soapenv:Body></soapenv:Envelope>
';
RESPONSE: $VAR1 = '<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
<soapenv:Body>
<LogoutResponse xmlns="urn:vim25"></LogoutResponse>
</soapenv:Body>
</soapenv:Envelope>';
I am using the schema supplied with the sdk.  I have modified vmclone.xml file that was supplied and put in the domain that I want it to join and the user name and password...  my customize .xml is as follows..
<Specification>
   <Customization-Spec>
          <Auto-Logon>1</Auto-Logon>
          <Virtual-Machine-Name>2LBNNode1</Virtual-Machine-Name>
      <Timezone>140</Timezone>
          <Domain>billd.local</Domain>
          <Domain-User-Name>administrator</Domain-User-Name>
          <Domain-User-Password>secret</Domain-User-Password>
          <Full-Name>administrator</Full-Name>
          <Organization-Name>billd</Organization-Name>
   </Customization-Spec>
<Virtual-Machine-Spec>
      <Guest-Id>windows7server64guest</Guest-Id>
      <Memory>1024</Memory>
      <Disksize>10194304</Disksize>
      <Number-of-CPUS>1</Number-of-CPUS>
  </Virtual-Machine-Spec>
</Specification>

as I want to be able to create and customise a datacenter with 9 VMs in it for demonstrations, I am hoping to script the all of this as I will do it quite frequently, but i am currently stuck.  The verbose log seems to be saying something about encoding or something up with the schema... but it doesn;t mean much to me, has anyone else any expereince?

thanks

Bill

Bill Dossett
0 Kudos
2 Replies
wsaxon
Contributor
Contributor

I have - have always had - the same problem with customizing the guest. You need to look in the vpxd-#.log file on your vCenter server to get the actual error. The SOAP fault is useless on its own.

In my case, the error was this:

[2012-10-16 18:07:39.532 04992 error 'App' opID=29807111] [VmCustomizer] Error occured while creating deploy package. Msg: oobeSystem.Microsoft-Windows-Shell-Setup.UserAccounts.AdministratorPassword.EncryptedValue

My source VM (and yours?) is Server 2008 R2. Searching pointed me here:

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=201743...

In short, the local Administrator PW is blank in the customization spec. How do you set that in your XML file? Well, that's a good question. By default you can't, because:

  1. The element is not defined in the .xsd schema file.
  2. The get_customization_spec subroutine in vmware-vcli/apps/AppUtil/VMUtil.pm doesn't read the nonexistent (see #1) element value.

To get around this, I patched the guestinfo.xsd and VMUtil.pm (see attachments). That's enough to get the clone to work, and once you power on the resulting VM the customization will start. It still fails though, because the same VMUtil library is hardcoding a product key of "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX," which causes sysprep to fail. There is no schema element definition for the product key either. These and any other missing/wrong values will have to be added to the xsd and VMUtil.pm for guest customization to really work.

billdossett
Hot Shot
Hot Shot

huh, thanks for that, much appreciated!  I'm not actually using this stuff in anger yet, mostly just lab stunts, but I am studying for my VCAP DCA and trying to get a feel for scripting, command line and also will be working in an OnDemand SaaS datacentre enviro so and thought this would be useful... Thanks again.

Bill Dossett
0 Kudos