2016-03-28 15 views
-1

Linux'ta VMware perl sdk kullanarak bir kümeyle ilgili tüm veri depolarının adı, Kapasite alanı, dunesId listelenmesi mümkün müdür?VMware perl sdk ile küme veri kümeleri nasıl alınır?

ComputeResource'u almak için Vim::find_entity_views'u kullanmayı deneyin ve bunların Özellikler: datastore, host olduğunu bilin.

+0

'baskı qx (df)' in veri deposu listesini almak mümkün? – mob

cevap

0

Evet onun bir küme

my $cluster_view = Vim::find_entity_view(view_type => 'ClusterComputeResource', 
              filter => { name => $cluster_name }); 
########## Error trap: verify if the cluster_view variable was set in the previous command 
##########    if it was not set, the Cluster Name is incorrect 
if (!$cluster_view) { 
    die "\nERROR: '" . $cluster_name . "' was not found in the VMware Infrastructure\n\n"; 
} 

########## Print the table header 
print "\n"; 
print "|--------------------------------------------------------------------------|\n"; 
print "| VMware Cluster: " . $cluster_view->name . "\n"; 
print "|--------------------------------------------------------------------------|\n"; 

########## Get a view of the ESX Hosts in the specified Cluster 
my $host_views = Vim::find_entity_views(view_type => 'HostSystem', 
             begin_entity => $cluster_view); 

foreach (@$host_views) { 
#  print "\n", $_->name; 
     print "\n|--------------------------------------------------------------------------|\n"; 
     print "| Datastore in ESXI Host(s) in " . $_->name . "\n"; 
     print "|--------------------------------------------------------------------------|\n"; 
     print "\n"; 
     my $datastores = Vim::get_views(mo_ref_array => $_->datastore); 
     foreach(@$datastores) { 
       print "\n" . $_->summary->name; 
     } 
} 
İlgili konular