VMware {code} Community
ummak
Contributor
Contributor

How to get Cluster Name using internal name

I'm trying to get the Cluster name using the internal name: I'm using this line but it keeps failing

my $ccrv = Vim::find_entity_view(view_type => 'ClusterComputeResource', filter => \{'mo_ref.value' => $internal_name});

print Dumper ($ccrv);

The error is:

SOAP Fault:

Fault string:

Fault detail:

$VAR1 = bless( {

'name' => 'mo_ref.value'

}, 'InvalidProperty' );

Reply
0 Kudos
1 Reply
admin
Immortal
Immortal

Using the Internal Name, you can create a ManagedObjectReference to ClusterComputeResource. Instead of using "find_view", now go ahead and use "get_view'

my $cluster_compute = ManagedObjectReference->new (type => 'ClusterComputeResource', value=> 'xxxVal');

my $clusters = Vim::get_view (mo_ref=>$cluster_compute);

Reply
0 Kudos