Questions tagged [govmomi]

15 questions
1
vote
0 answers

govmomi cluster name on mo.MirtualMachine

In my function, i have fetched all my needed VM's from the vCenter - when looping through them i would like to fetch the cluster that the virtualmachine is running under. Is this possible without further lookups to the vCenter API for each VM? …
Rygo
  • 159
  • 1
  • 8
1
vote
0 answers

Error 404 Not Found while unit testing govmomi vapi rest client using simulator

I'm working with vSphere govmomi client to interact with vCenter. I'm having problem in unit testing the govmomi vapi/rest client. The sample code for creating rest client is: var insecure bool = true type RestClient struct { url *url.URL …
temptech
  • 11
  • 2
1
vote
1 answer

Can remotely create a VM using govc, but not with Terraform

Trying to create a VM in vSphere, preferably using Terraform to do it, but keep getting Error: error creating virtual machine: ServerFaultCode: Permission to perform this operation was denied. error mentioned in the SOAP response, as captured in…
1
vote
0 answers

How to execute govc/pyvmomi run command which lists output of server on local pc

I am able to list all the vm's using govmomi(not govc which is one line command in terminal) but I am trying to implement this: govc guest.run -vm $vm_name cat sample.txt from scratch rather than running it via govc. The docs seems to be confusing.…
mozilla-firefox
  • 864
  • 1
  • 15
  • 23
1
vote
0 answers

Golang govmomi filter VMs by Resource Pool

I currently have some go code to list VM names and Resource Pools with govmomi library. In the output I have some sort of Resource Pool identifiers, not actual names. So I have two questions: 1. Is there a clean and simple way to filter VMs by…
Alex Nikitin
  • 514
  • 5
  • 12
1
vote
1 answer

nil point deference in golang using govmomi library

I'm trying to use the govmomi library (https://github.com/vmware/govmomi) to make some automated changes to a VM but I can't seem to get around the nil pointer exceptions on line 134 and 136 for the last few hours. I got it to work at one point but…
lightweight
  • 3,227
  • 14
  • 79
  • 142
1
vote
0 answers

enabling cpu performance counters on vmware vm

I'm trying to use govc to enable cpu performace counters on a vm but can't quite figure out how to do it...in the UI I have to shut it down, enable them, and then start it back up...but I don't see an option to enable cpu performance counters in…
lightweight
  • 3,227
  • 14
  • 79
  • 142
0
votes
0 answers

How do I download all vmdk`s from VMWare (Golang)

Im would like to retrieve all VMDK files from VMWare. Im using Golang and govmomi library. I know about Download method which attached to vim25.Client, but I should URL`s of vmdk files to download it. How do I get this URL or maybe u know another…
CupaState
  • 65
  • 3
0
votes
1 answer

Govmomi Rest/Vapi API does not support ESX() simulators to create Rest clients?

I was doing some unit testing with vSphere Govmomi/vapi REST client used to interact with V Center. var insecure bool = true type RestClient struct { url *url.URL restClient *rest.Client } func (c *RestClient) GetRestClient(ctx context.Context)…
0
votes
2 answers

Return non-zero value on unsuccessful govc pool.info command

I use govc to create resources in VMware. Before creating a new resource pool I want to verify if a resource pool exists with the same name. Running govc pool.info on an existing pool returns information about the existing pool and the command exits…
Erik
  • 133
  • 15
0
votes
1 answer

How to get vCenter version using govmomi client API?

I have a go client initialized to connect to a vCenter as follows. I am trying to get the version of the vCenter using the client. I did not find a very good source for this. Which arguments to use inside retrieve() API to get the version and other…
AnilJ
  • 1,951
  • 2
  • 33
  • 60
0
votes
2 answers

Set CPU affinity for specific VM on VMware ESXI using govc CLI

I have shell scripts that I use to programmatically configure my virtual machines (VMs) on my VMware ESXi host. I use the "govc" command-line-interface (CLI) which provides a suite of commands to configure my VMs that run on my ESXI (i.e., powering…
ennth
  • 1,698
  • 5
  • 31
  • 63
0
votes
1 answer

govmomi Missing Cluster name ClusterComputeResource?

Have been using the following code from the issue How to retrieve all clusters? https://github.com/vmware/govmomi/issues/1674 To retrieve cluster information, though the cluster name appears not to be returned, does anyone know how i would retrieve…
user3052323
  • 3
  • 1
  • 2
0
votes
1 answer

Reflect showing different a different type than error

Background: Im using govmomi for configuration collection for vmware. I'm currently in the process of getting the datastore info I require. One of the fields I need is the disk Naa. This can be found in the VmfsDatastoreInfo struct under the Vmfs…
BrandonW
  • 17
  • 4
-2
votes
1 answer

How does golang do this?

After having issues understanding and being unable to access the ClusterComputeResourceSummary.UsageSummary field while working with govmomi, I was able to find a link that helped solve my problem, however, I am curious to understand how Golang is…
foobar
  • 87
  • 6