Hi ,

I am trying to get a VCL standalone installation done and I am trying to
capture a linux image. But I am getting the following error in the VMware
perl tool kit files.
The problem is that at the entry point into the capture routine , hostname
and VMtype are getting detected proprely .i.e. vmguest-1 and vmwareGSX.  But
at the end, when the power off status is being determined, it tries to get
the vm paths and there the hostname is getting retrieved as 1vmguest-1 and
vmguest-1.

if you actually look into the code of get_vm_paths in vmware.pm, it says

# If GSX use image name
        if ($vmtype_name =~ /(vmware|vmwareGSX)$/) {
            $vmdk_name = $image_name;
        }
       * # If ESX use requestid+shortname
        elsif ($vmtype_name =~ /(vmwareESX3)/) {
            $vmdk_name = "$reservation_id$computer_short_name";
        }*




vmtype_name is getting detected as vmware ESX and from then on, hostname and
vmdk files are getting renamed as 1vmguest-1 and so on.... I wanted to know
if I am missing something here or is it because of some incorrect setting

2010-04-15 16:19:54|11685|1:1|image|DataStructure.pm:_automethod(697)|data
structure updated:
$self->request_data->{reservation}{1}{imagerevision}{datecreated}
|11685|1:1|image| imagerevision_date_created = 2010-04-15 16:19:54
2010-04-15 16:19:54|11685|1:1|image|image.pm:process(161)|calling
provisioning module's capture() subroutine
*2010-04-15 16:19:54|11685|1:1|image|vmware.pm:capture(1175)|req=1, res=1:
new name: vmwarelinux-base8-v1
2010-04-15 16:19:54|11685|1:1|image|vmware.pm:capture(1176)|req=1, res=1:
computer_name: vmguest-1
2010-04-15 16:19:54|11685|1:1|image|vmware.pm:capture(1177)|req=1, res=1:
vmhost_hostname: localvmhost
2010-04-15 16:19:54|11685|1:1|image|vmware.pm:capture(1178)|req=1, res=1:
vmtype_name: vmwareGSX
*2010-04-15 16:19:54|11685|1:1|image|utils.pm:run_ssh_command(6180)|executing
SSH command on vmguest-1:
|11685|1:1|image| /usr/bin/ssh -i /etc/vcl/vcl.key  -l root -p 22 -x
vmguest-1 'chown root currentimage.txt; chmod 777 currentimage.txt' 2>&1
2010-04-15 
16:19:54|11685|1:1|image|utils.pm:run_ssh_command(6262)|run_ssh_command
output:
|11685|1:1|image| chown: cannot access `currentimage.txt': No such file or
directory
|11685|1:1|image| chmod: cannot access `currentimage.txt': No such file or
directory
2010-04-15 16:19:54|11685|1:1|image|utils.pm:run_ssh_command(6272)|SSH
command executed on vmguest-1, command:
|11685|1:1|image| /usr/bin/ssh -i /etc/vcl/vcl.key  -l root -p 22 -x
vmguest-1 'chown root currentimage.txt; chmod 777 currentimage.txt' 2>&1
|11685|1:1|image| returning (1, "chown: cannot access `currenti...")
2010-04-15 
16:19:54|11685|1:1|image|utils.pm:write_currentimage_txt(6500)|updated
ownership and permissions on currentimage.txt
2010-04-15 16:19:54|11685|1:1|image|utils.pm:run_ssh_command(6180)|executing
SSH command on vmguest-1:
|11685|1:1|image| /usr/bin/ssh -i /etc/vcl/vcl.key  -l root -p 22 -x
vmguest-1 'echo -e "vmwarelinux-base8-v1\r\nid=10\r\nprettyname=No Apps
(Linux)\r\nimagerevision_id=10\r\nimagerevision_datecreated=2010-04-15
16:19:54\r\ncomputer_id=2\r\ncomputer_hostname=vmguest-1" > currentimage.txt
& cat currentimage.txt' 2>&1
2010-04-15 
16:19:55|11685|1:1|image|utils.pm:run_ssh_command(6262)|run_ssh_command
output:
|11685|1:1|image| vmwarelinux-base8-v1
|11685|1:1|image| id=10
|11685|1:1|image| prettyname=No Apps (Linux)
|11685|1:1|image| imagerevision_id=10
|11685|1:1|image| imagerevision_datecreated=2010-04-15 16:19:54
|11685|1:1|image| computer_id=2
|11685|1:1|image| computer_hostname=vmguest-1
2010-04-15 16:19:55|11685|1:1|image|utils.pm:run_ssh_command(6276)|SSH
command executed on vmguest-1, returning (0, "vmwarelinux-base8-v1 id=10
pre...")
2010-04-15 
16:19:55|11685|1:1|image|utils.pm:write_currentimage_txt(6510)|created
currentimage.txt file on vmguest-1:
|11685|1:1|image| vmwarelinux-base8-v1
|11685|1:1|image| id=10
|11685|1:1|image| prettyname=No Apps (Linux)
|11685|1:1|image| imagerevision_id=10
|11685|1:1|image| imagerevision_datecreated=2010-04-15 16:19:54
|11685|1:1|image| computer_id=2
|11685|1:1|image| computer_hostname=vmguest-1
2010-04-15 16:19:55|11685|1:1|image|vmware.pm:capture(1181)|req=1, res=1:
currentimage.txt updated on vmguest-1
2010-04-15 16:19:55|11685|1:1|image|vmware.pm:capture(1200)|calling OS
module's pre_capture() subroutine
2010-04-15
16:19:55|11685|1:1|image|DataStructure.pm:get_computer_private_ip_address(1442)|attempting
to retrieve private IP address for computer: vmguest-1
2010-04-15
16:19:55|11685|1:1|image|DataStructure.pm:get_computer_private_ip_address(1446)|retrieved
contents of /etc/hosts on this management node, contains 6 lines
2010-04-15
16:19:55|11685|1:1|image|DataStructure.pm:get_computer_private_ip_address(1479)|found
line for 'vmguest-1' in /etc/hosts:
|11685|1:1|image| 9.37.244.183 vmguest-1
2010-04-15
16:19:55|11685|1:1|image|DataStructure.pm:get_computer_private_ip_address(1490)|found
IP address: 9.37.244.183
2010-04-15 16:19:55|11685|1:1|image|DataStructure.pm:_automethod(697)|data
structure updated:
$self->request_data->{reservation}{1}{computer}{privateIPaddress}
|11685|1:1|image| computer_private_ip_address = 9.37.244.183
2010-04-15 16:19:55|11685|1:1|image|Linux.pm:pre_capture(96)|beginning
Linux-specific image capture preparation tasks: vmwarelinux-base8-v1 on
vmguest-1
2010-04-15 16:19:55|11685|1:1|image|utils.pm:run_ssh_command(6180)|executing
SSH command on vmguest-1:
|11685|1:1|image| /usr/bin/ssh -i /etc/vcl/vcl.key  -l root -p 22 -x
vmguest-1 'pkill -KILL -u admin' 2>&1
2010-04-15 
16:19:55|11685|1:1|image|utils.pm:run_ssh_command(6262)|run_ssh_command
output:
|11685|1:1|image| pkill: invalid user name: admin
2010-04-15 16:19:55|11685|1:1|image|utils.pm:run_ssh_command(6272)|SSH
command executed on vmguest-1, command:
|11685|1:1|image| /usr/bin/ssh -i /etc/vcl/vcl.key  -l root -p 22 -x
vmguest-1 'pkill -KILL -u admin' 2>&1
|11685|1:1|image| returning (2, "pkill: invalid user name: admi...")
2010-04-15 16:19:55|11685|1:1|image|Linux.pm:logoff_user(490)|logged off
admin from vmguest-1
2010-04-15 16:19:55|11685|1:1|image|Linux.pm:pre_capture(101)|forced admin
off vmguest-1
2010-04-15 16:19:55|11685|1:1|image|utils.pm:run_ssh_command(6180)|executing
SSH command on vmguest-1:
|11685|1:1|image| /usr/bin/ssh -i /etc/vcl/vcl.key  -l root -p 22 -x
vmguest-1 '/usr/sbin/userdel admin' 2>&1
2010-04-15 
16:19:56|11685|1:1|image|utils.pm:run_ssh_command(6262)|run_ssh_command
output:
|11685|1:1|image| userdel: user admin does not exist
2010-04-15 16:19:56|11685|1:1|image|utils.pm:run_ssh_command(6272)|SSH
command executed on vmguest-1, command:
|11685|1:1|image| /usr/bin/ssh -i /etc/vcl/vcl.key  -l root -p 22 -x
vmguest-1 '/usr/sbin/userdel admin' 2>&1
|11685|1:1|image| returning (6, "userdel: user admin does not e...")
2010-04-15 16:19:56|11685|1:1|image|utils.pm:run_ssh_command(6180)|executing
SSH command on vmguest-1:
|11685|1:1|image| /usr/bin/ssh -i /etc/vcl/vcl.key  -l root -p 22 -x
vmguest-1 '/usr/sbin/userdel admin' 2>&1
2010-04-15 
16:19:56|11685|1:1|image|utils.pm:run_ssh_command(6262)|run_ssh_command
output:
|11685|1:1|image| userdel: user admin does not exist
2010-04-15 16:19:56|11685|1:1|image|utils.pm:run_ssh_command(6272)|SSH
command executed on vmguest-1, command:
|11685|1:1|image| /usr/bin/ssh -i /etc/vcl/vcl.key  -l root -p 22 -x
vmguest-1 '/usr/sbin/userdel admin' 2>&1
|11685|1:1|image| returning (6, "userdel: user admin does not e...")
2010-04-15 16:19:56|11685|1:1|image|Linux.pm:delete_user(553)|attempted to
delete usergroup for admin
2010-04-15 16:19:56|11685|1:1|image|utils.pm:run_ssh_command(6180)|executing
SSH command on vmguest-1:
|11685|1:1|image| /usr/bin/ssh -i /etc/vcl/vcl.key  -l root -p 22 -x
vmguest-1 'sed -ie "/^AllowUsers .*/d" /etc/ssh/external_sshd_config' 2>&1
2010-04-15 
16:19:56|11685|1:1|image|utils.pm:run_ssh_command(6262)|run_ssh_command
output:
|11685|1:1|image| none
2010-04-15 16:19:56|11685|1:1|image|utils.pm:run_ssh_command(6276)|SSH
command executed on vmguest-1, returning (0, "none")
2010-04-15 16:19:56|11685|1:1|image|Linux.pm:delete_user(562)|cleared
AllowUsers directive from external_sshd_config
2010-04-15 16:19:56|11685|1:1|image|utils.pm:run_ssh_command(6180)|executing
SSH command on vmguest-1:
|11685|1:1|image| /usr/bin/ssh -i /etc/vcl/vcl.key  -l root -p 22 -x
vmguest-1 'sed -ie "/^admin .*/d" /etc/sudoers' 2>&1
2010-04-15 
16:19:57|11685|1:1|image|utils.pm:run_ssh_command(6262)|run_ssh_command
output:
|11685|1:1|image| none
2010-04-15 16:19:57|11685|1:1|image|utils.pm:run_ssh_command(6276)|SSH
command executed on vmguest-1, returning (0, "none")
2010-04-15 16:19:57|11685|1:1|image|Linux.pm:delete_user(574)|cleared admin
from /etc/sudoers
2010-04-15 16:19:57|11685|1:1|image|Linux.pm:pre_capture(106)|admin deleted
from vmguest-1
2010-04-15 16:19:57|11685|1:1|image|utils.pm:run_ssh_command(6180)|executing
SSH command on vmguest-1:
|11685|1:1|image| /usr/bin/ssh -i /etc/vcl/vcl.key  -l root -p 22 -x
vmguest-1 '/usr/sbin/tmpwatch -f 0 /tmp; /bin/cp /dev/null /var/log/wtmp'
2>&1
2010-04-15 
16:19:57|11685|1:1|image|utils.pm:run_ssh_command(6262)|run_ssh_command
output:
|11685|1:1|image| none
2010-04-15 16:19:57|11685|1:1|image|utils.pm:run_ssh_command(6276)|SSH
command executed on vmguest-1, returning (0, "none")
2010-04-15 16:19:57|11685|1:1|image|Linux.pm:pre_capture(111)|cleartmp
precapture vmguest-1
2010-04-15
16:19:57|11685|1:1|image|Linux.pm:clear_private_keys(224)|perparing to clear
known identity keys
2010-04-15 16:19:57|11685|1:1|image|utils.pm:run_ssh_command(6180)|executing
SSH command on vmguest-1:
|11685|1:1|image| /usr/bin/ssh -i /etc/vcl/vcl.key  -l root -p 22 -x
vmguest-1 '/bin/rm -f /root/.ssh/id_rsa /root/.ssh/id_rsa.pub' 2>&1
2010-04-15 
16:19:58|11685|1:1|image|utils.pm:run_ssh_command(6262)|run_ssh_command
output:
|11685|1:1|image| none
2010-04-15 16:19:58|11685|1:1|image|utils.pm:run_ssh_command(6276)|SSH
command executed on vmguest-1, returning (0, "none")
2010-04-15 16:19:58|11685|1:1|image|Linux.pm:clear_private_keys(232)|cleared
any id_rsa keys from /root/.ssh
2010-04-15 16:19:58|11685|1:1|image|Linux.pm:pre_capture(147)|shutting down
node for Linux imaging sequence
2010-04-15 16:19:58|11685|1:1|image|utils.pm:run_ssh_command(6180)|executing
SSH command on vmguest-1:
|11685|1:1|image| /usr/bin/ssh -i /etc/vcl/vcl.key  -l root -p 22 -x
vmguest-1 '/sbin/shutdown -h now' 2>&1
2010-04-15 16:19:59|11536|vcld:main(165)|lastcheckin time updated for
management node 1: 2010-04-15 16:19:58
2010-04-15 
16:20:00|11685|1:1|image|utils.pm:run_ssh_command(6262)|run_ssh_command
output:
|11685|1:1|image| none
2010-04-15 16:20:00|11685|1:1|image|utils.pm:run_ssh_command(6276)|SSH
command executed on vmguest-1, returning (0, "none")
2010-04-15 16:20:00|11685|1:1|image|Linux.pm:pre_capture(149)|sleeping for
60 seconds while machine shuts down
2010-04-15 16:20:05|11536|vcld:main(165)|lastcheckin time updated for
management node 1: 2010-04-15 16:20:05
2010-04-15 16:20:10|11536|vcld:main(165)|lastcheckin time updated for
management node 1: 2010-04-15 16:20:10
2010-04-15 16:20:15|11536|vcld:main(165)|lastcheckin time updated for
management node 1: 2010-04-15 16:20:15
2010-04-15 16:20:20|11536|vcld:main(165)|lastcheckin time updated for
management node 1: 2010-04-15 16:20:20
2010-04-15 16:20:25|11536|vcld:main(165)|lastcheckin time updated for
management node 1: 2010-04-15 16:20:25
2010-04-15 16:20:30|11536|vcld:main(165)|lastcheckin time updated for
management node 1: 2010-04-15 16:20:30
2010-04-15 16:20:35|11536|vcld:main(165)|lastcheckin time updated for
management node 1: 2010-04-15 16:20:35
2010-04-15 16:20:40|11536|vcld:main(165)|lastcheckin time updated for
management node 1: 2010-04-15 16:20:40
2010-04-15 16:20:45|11536|vcld:main(165)|lastcheckin time updated for
management node 1: 2010-04-15 16:20:45
2010-04-15 16:20:50|11536|vcld:main(165)|lastcheckin time updated for
management node 1: 2010-04-15 16:20:50
2010-04-15 16:20:55|11536|vcld:main(165)|lastcheckin time updated for
management node 1: 2010-04-15 16:20:55
2010-04-15 16:21:00|11685|1:1|image|Linux.pm:pre_capture(152)|returning 1
*2010-04-15 16:21:00|11685|1:1|image|vmware.pm:get_vm_paths(2655)|vm
locations:
|11685|1:1|image| vmdk name: vmwarelinux-base8-v1
|11685|1:1|image| vmx path: /var/lib/vmware/Virtual\
Machines/1vmguest-1/1vmguest-1.vmx
|11685|1:1|image| vm directory: 1vmguest-1
|11685|1:1|image| base vm directory: 1vmguest-1
*2010-04-15 16:21:00|11685|1:1|image|vmware.pm:power_status(2577)|attempting
to execute vmware-cmd getstate
2010-04-15 16:21:00|11685|1:1|image|utils.pm:run_ssh_command(6180)|executing
SSH command on localvmhost:
|11685|1:1|image| /usr/bin/ssh -i /etc/vcl/vcl.key  -l root -p 22 -x
localvmhost 'vmware-cmd /var/lib/vmware/Virtual\
Machines/1vmguest-1/1vmguest-1.vmx getstate' 2>&1
2010-04-15 16:21:00|11536|vcld:main(165)|lastcheckin time updated for
management node 1: 2010-04-15 16:21:00

|11685|1:1|image| ---- WARNING ----
|11685|1:1|image| 2010-04-15
16:21:02|11685|1:1|image|vmware.pm:power_status(2585)|failed
to run vmware-cmd getstate for 1vmguest-1 vm, exit status: 1, output:
|11685|1:1|image| Use of uninitialized value in scalar chomp at
/usr/lib/perl5/site_perl/5.8.8/VMware/VILib.pm line 420. Enter username:
Enter password: Must have one of command options 'sessionfile' or a
'username' and 'password' pair  Common VI options:     --config (variable
VI_CONFIG)       Location of the VI Perl configuration file    --help
Display usage information for the script    --password (variable
VI_PASSWORD)       Password    --portnumber (variable VI_PORTNUMBER)
Port used to connect to server    --protocol (variable VI_PROTOCOL, default
'https')       Protocol used to connect to server    --server (variable
VI_SERVER, default 'localhost')       VI server to connect to
--servicepath (variable VI_SERVICEPATH, default '/sdk/webService')
Service path used to connect to server    --sessionfile (variable
VI_SESSIONFILE)       File containing session ID/cookie to utilize    --url
(variable VI_URL)       VI SDK URL to connect to    --username (variable
VI_USERNAME)       Username    --verbose (variable VI_VERBOSE)       Display
additional debugging information    --version       Display version
information for the script Use of uninitialized value in scalar chomp at
/usr/lib/perl5/site_perl/5.8.8/VMware/VILib.pm line 427.
|11685|1:1|image| ( 0) utils.pm, notify (line: 737)
|11685|1:1|image| (-1) vmware.pm, power_status (line: 2585)
|11685|1:1|image| (-2) vmware.pm, capture (line: 1208)
|11685|1:1|image| (-3) image.pm, process (line: 162)
|11685|1:1|image| (-4) vcld, make_new_child (line: 594)
|11685|1:1|image| (-5) vcld, main (line: 341)

Use of uninitialized value in concatenation (.) or string at
    /usr/local/vcl/bin/../lib/VCL/Module/Provisioning/vmware.pm line 1209
(#1)
    (W uninitialized) An undefined value was used as if it were already
    defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
    To suppress this warning assign a defined value to your variables.

    To help you figure out what was undefined, perl tells you what operation
    you used the undefined value in.  Note, however, that perl optimizes
your
    program and the operation displayed in the warning may not necessarily
    appear literally in your program.  For example, "that $foo" is
    usually optimized into "that " . $foo, and the warning will refer to
    the concatenation (.) operator, even though there is no . in your
    program.

|11685|1:1|image| ---- WARNING ----
|11685|1:1|image| 2010-04-15
16:21:02|11685|1:1|image|vcld:warning_handler(636)|Use of uninitialized
value in concatenation (.) or string at
/usr/local/vcl/bin/../lib/VCL/Module/Provisioning/vmware.pm line 1209.
|11685|1:1|image| ( 0) utils.pm, notify (line: 737)
|11685|1:1|image| (-1) vcld, warning_handler (line: 636)
|11685|1:1|image| (-2) vmware.pm, capture (line: 1209)
|11685|1:1|image| (-3) image.pm, process (line: 162)
|11685|1:1|image| (-4) vcld, make_new_child (line: 594)
|11685|1:1|image| (-5) vcld, main (line: 341)

2010-04-15 16:21:02|11685|1:1|image|vmware.pm:capture(1209)|retrieved power
status:

|11685|1:1|image| ---- WARNING ----
|11685|1:1|image| 2010-04-15
16:21:02|11685|1:1|image|vcld:warning_handler(636)|Use of uninitialized
value in string eq at /usr/local/vcl/bin/../lib/VCL/Module/Provisioning/
vmware.pm line 1210.
|11685|1:1|image| ( 0) utils.pm, notify (line: 737)
|11685|1:1|image| (-1) vcld, warning_handler (line: 636)
|11685|1:1|image| (-2) vmware.pm, capture (line: 1210)
|11685|1:1|image| (-3) image.pm, process (line: 162)
|11685|1:1|image| (-4) vcld, make_new_child (line: 594)
|11685|1:1|image| (-5) vcld, main (line: 341)


|11685|1:1|image| ---- WARNING ----
|11685|1:1|image| 2010-04-15
16:21:02|11685|1:1|image|vcld:warning_handler(636)|Use of uninitialized
value in string eq at /usr/local/vcl/bin/../lib/VCL/Module/Provisioning/
vmware.pm line 1210.
|11685|1:1|image| ( 0) utils.pm, notify (line: 737)
|11685|1:1|image| (-1) vcld, warning_handler (line: 636)
|11685|1:1|image| (-2) vmware.pm, capture (line: 1210)
|11685|1:1|image| (-3) image.pm, process (line: 162)
|11685|1:1|image| (-4) vcld, make_new_child (line: 594)
|11685|1:1|image| (-5) vcld, main (line: 341)


|11685|1:1|image| ---- WARNING ----
|11685|1:1|image| 2010-04-15
16:21:02|11685|1:1|image|vmware.pm:capture(1226)|failed
to determine power status of vmguest-1
|11685|1:1|image| ( 0) utils.pm, notify (line: 737)
|11685|1:1|image| (-1) vmware.pm, capture (line: 1226)
|11685|1:1|image| (-2) image.pm, process (line: 162)
|11685|1:1|image| (-3) vcld, make_new_child (line: 594)
|11685|1:1|image| (-4) vcld, main (line: 341)


|11685|1:1|image| ---- WARNING ----
|11685|1:1|image| 2010-04-15
16:21:02|11685|1:1|image|image.pm:process(166)|vmwarelinux-base8-v1
image failed to be captured by provisioning module
|11685|1:1|image| ( 0) utils.pm, notify (line: 737)
|11685|1:1|image| (-1) image.pm, process (line: 166)
|11685|1:1|image| (-2) vcld, make_new_child (line: 594)
|11685|1:1|image| (-3) vcld, main (line: 341)

No recipient addresses found in header
2010-04-15 16:21:02|11685|1:1|image|utils.pm:mail(1348)|SUCCESS -- Sending
mail To: , PROBLEM -- image.pm

|11685|1:1|image| ---- CRITICAL ----
|11685|1:1|image| 2010-04-15
16:21:02|11685|1:1|image|image.pm:reservation_failed(390)|vmwarelinux-base8-v1
image creation failed
|11685|1:1|image| ( 0) utils.pm, notify (line: 737)
|11685|1:1|image| (-1) image.pm, reservation_failed (line: 390)
|11685|1:1|image| (-2) image.pm, process (line: 167)
|11685|1:1|image| (-3) vcld, make_new_child (line: 594)
|11685|1:1|image| (-4) vcld, main (line: 341)



Tnx
vinay

Reply via email to