wenxin1234114's Posts

thank you very much .It solved my problem
the srcript output is not english ,how to transfer to english ?
where is the script ?
I check your script carefully ,you have to write the $customization_user_data before object CustomizationSysprep,you can write like this : my $customization_user_data = CustomizationUserData->n... See more...
I check your script carefully ,you have to write the $customization_user_data before object CustomizationSysprep,you can write like this : my $customization_user_data = CustomizationUserData->new( computerName => CustomizationFixedName->new(name => $host_name), fullName => $full_name, orgName => $org_name, productId => $prod_ID, );
hi nileshjais , do you know how to define disk size when clone vm ? I have a script can define mem,cpu ..etc .but not disk .
you searched bbs ,it has .
Any one know how to define disk size when clone one vm ? following code doesn't work : my $disk = VirtualDisk->new (capacityInKB => $size); my $devspec = VirtualDevice... See more...
Any one know how to define disk size when clone one vm ? following code doesn't work : my $disk = VirtualDisk->new (capacityInKB => $size); my $devspec = VirtualDeviceConfigSpec->new(operation => VirtualDeviceConfigSpecOperation->new('add'),          device => $disk,         ); my $cust_hardware = VirtualMachineConfigSpec->new (          deviceChange => [$devspec] , ); my $clone_spec = VirtualMachineCloneSpec->new( config => $cust_hardware, );
do you know where there are sample scripts ?Thanks .
as far as i know ,it can not do that .If you know ,please tell me .
good answer .do you know how to extend disk size on original disk ?
Dear nilesh, Actually in perl sdk ,it can do that .You can use data Object  CustomizationSysprep for windows and CustomizationLinuxPrep for linux vm .it is not so hard . you can referred th... See more...
Dear nilesh, Actually in perl sdk ,it can do that .You can use data Object  CustomizationSysprep for windows and CustomizationLinuxPrep for linux vm .it is not so hard . you can referred this page :http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/index-do_types.html
Hi, Is it there any method to get host and vm performance data ,like cpu ,mem and io utilization ?  I am guessing data in vCenter server database ,But I don't know how to translate it .I want ge... See more...
Hi, Is it there any method to get host and vm performance data ,like cpu ,mem and io utilization ?  I am guessing data in vCenter server database ,But I don't know how to translate it .I want get these data integrated with other app . Thanks in advance .
Hi, I want to clone vm with perl sdk ,but we don't have VC .We just use esxi ,could someone tell how to clone or create vm ?
Hi , I am planning to extract performance data(cpu,net,storage,ram) of all vms and host and push to mysql ,but I don't how to do it .Anyone can guide me ?I appreciate . following is my code ,... See more...
Hi , I am planning to extract performance data(cpu,net,storage,ram) of all vms and host and push to mysql ,but I don't how to do it .Anyone can guide me ?I appreciate . following is my code ,only can show vms : #!/usr/bin/perl   2 use strict;   3 use warnings;   4 use DBI;   5 use utf8;   6 use VMware::VIRuntime;   7 use VMware::VILib;   8   9 10 my %opts = ( 11     cluster => { 12         type =>"=s" , 13         help => "Enter the Cluster name" , 14         required => 1, 15     } 16 17 ); 18 19 #connect the host 20 Opts::add_options(%opts); 21 Opts::parse(); 22 Opts::validate(); 23 Util::connect(); 24 25 #script start 26 my $cluster = Vim::find_entity_views (view_type =>'ClusterComputeResource', 27                                       properties => ['name'], 28                                       filter =>{'name' =>Opts::get_option('cluster')}); 29 30 my $vms = Vim::find_entity_views( view_type=>'VirtualMachine', 31                                   properties => ['name']); 32                                   #begin_entity => $cluster );    33 34     foreach my $vm ( @{$vms || []} ) { 35         print "Name:" .$vm->name "\n"; 36     } 37 38 my $hosts = Vim::find_entity_views( view_type=>'HostSystem', 39                                   properties => ['name']); 40 41     foreach my $host ( @{$hosts || []} ) { 42         print "Name:" .$host->name ."\n"; 43     } 44 45 Util::disconnect;                                                
I have fixed this issue.thanks. comment this line : begin_entity => $cluster );  
I am wanna to connect my Vcenter to show one cluster all vms ,but it report error :Can't call method "serialize" on unblessed reference at /usr/lib/perl5/5.8.8/VMware/VICommon.pm line 2435. I ... See more...
I am wanna to connect my Vcenter to show one cluster all vms ,but it report error :Can't call method "serialize" on unblessed reference at /usr/lib/perl5/5.8.8/VMware/VICommon.pm line 2435. I want to show cpu ,mem ,net ,io static ,and write all these data to mysql ,but I am stuck here . #!/usr/bin/perl use strict; use warnings; use DBI; use utf8; use VMware::VIRuntime; use VMware::VILib; my %opts = (     cluster => {         type =>"=s" ,         help => "Enter the Cluster name" ,         required => 1,     }   ); #connect the host Opts::add_options(%opts); Opts::parse(); Opts::validate(); Util::connect(); #script start my $cluster = Vim::find_entity_views (view_type =>'ClusterComputeResource',                                       properties => ['name'],                                       filter =>{'name' =>Opts::get_option('cluster')}); my $vms = Vim::find_entity_views( view_type=>'VirtualMachine',                                   properties => ['name'],                                   begin_entity => $cluster );        foreach my $vm ( @{$vms || []} ) {         my $vmname = '"' . $vm->{'name'} . '"';         print $vmname;     }   Util::disconnect; ~                
hi lamw I found your wiritten script : VMware vSphere Health Check Report v5.0.2, can I tranfer these vm (cpu,mem ,net ,load ) data to mysql ? thanks.
I have solved this issued .Just add record to /etc/hosts ip ,hostname ,and it work around .:smileylaugh:
I want to talk to esx server directly and use --host option ,but it doesn't work.And it's werid connect.pl worked fine.
1. # perl connect.pl --url  https://192.168.16.154/sdk/vimService  --username root Enter password: Connection Successful Server Time : 2012-08-07T12:41:27.765895Z 2. #perl viperforman... See more...
1. # perl connect.pl --url  https://192.168.16.154/sdk/vimService  --username root Enter password: Connection Successful Server Time : 2012-08-07T12:41:27.765895Z 2. #perl viperformance.pl --url  https://192.168.16.154:443/sdk/webService  --username root  --host 192.168.16.154 --countertype cpu Host 192.168.16.154 not found. Does anyone know this error reason ?thanks.