Hello,
I'm trying to customize a Linux (RHEL 6.4) VM's network configuration (IP address, dns, gateway, hostname) using the VMware Perl SDK. It works fine with VMware tools installed, but when using open-vm-tools it fails with the following error:
$VAR1 = bless( {
'queueTime' => '2014-10-29T09:29:04.537587Z',
'entityName' => 'my-new-hostname',
'error' => bless( {
'localizedMessage' => 'fault.CustomizationPending.summary',
'fault' => bless( {}, 'CustomizationPending' )
}, 'LocalizedMethodFault' ),
'reason' => bless( {
'userName' => 'deploypgih'
}, 'TaskReasonUser' ),
'cancelable' => '0',
'eventChainId' => '2057315',
'entity' => bless( {
'value' => 'vm-682',
'type' => 'VirtualMachine'
}, 'ManagedObjectReference' ),
'completeTime' => '2014-10-29T09:29:04.643604Z',
'state' => bless( {
'val' => 'error'
}, 'TaskInfoState' ),
'startTime' => '2014-10-29T09:29:04.544589Z',
'name' => 'CustomizeVM_Task',
'task' => bless( {
'value' => 'task-31912',
'type' => 'Task'
}, 'ManagedObjectReference' ),
'descriptionId' => 'VirtualMachine.customize',
'key' => 'task-31912',
'cancelled' => '0'
}, 'TaskInfo' );
SOAP Fault:
-----------
Fault string: fault.CustomizationPending.summary
Fault detail: CustomizationPending
I don't get why it says CustomizationPending as there is no other task running at the same time.
Here is the script used:
my $interfaceMacAddress=$vm->guest->net->[0]->macAddress; | # MAC address of interface (used to id the interface) |
my $dns_list = CustomizationGlobalIPSettings->new(
dnsServerList => \@dnsServers,
dnsSuffixList => \@dnsSuffixList);
my $linuxPrep = CustomizationLinuxPrep->new(
domain => $dnsDomain,
hostName => CustomizationFixedName->new(name => "$vmname"),
hwClockUTC => 0,
timeZone => "Europe/Paris ");
my $customizationIPSettings = CustomizationIPSettings->new(
dnsDomain => $dnsDomain,
dnsServerList => \@dnsServers,
ip => CustomizationFixedIp->new(ipAddress => "$ipAddress"),
gateway => \@gateway,
subnetMask => $netmask);
my $nic0_setting = CustomizationAdapterMapping->new(
adapter => $customizationIPSettings,
macAddress => $interfaceMacAddress);
my @nicsetting = ($nic0_setting);
my $customSpec = CustomizationSpec->new(
globalIPSettings => $dns_list,
identity => $linuxPrep,
nicSettingMap => \@nicsetting);
$task=$vm->CustomizeVM_Task(spec => $customSpec);
&wait_task_completion($task,color("bold green")."OK\n".color("reset"));
Is there something I am doing incorrectly here ?
Thanks in advance for your help.