Author Topic: vmgr.nsm connection to VMware vCenter server  (Read 330 times)

pvo

  • Newbie
  • *
  • Posts: 39
    • View Profile
vmgr.nsm connection to VMware vCenter server
« on: May 21, 2020, 01:54:46 pm »
I've tried to use vmgr.nsm. It works fine with ESXi hypervisors but when try to connect to a vCenter server it fails with following error:
Code: [Select]
2020.05.21 11:11:47.611 *W* [                   ] VMGR: Unable to add connection URL "esx://root@vcenter.mydomain.local/?no_verify=1" for connection name "vcenter"
The configuration is following:
Code: [Select]
[vmgr:vcenter]
Url = esx://root@vcenter.mydomain.local/?no_verify=1
Login = root
Password = XXX


The password in the real configuration is different but it is OK. I can login with this login and password to vCenter Web UI.

Did I do something wrong or supports vmgr.nsm ESXi hypervisors only?
« Last Edit: May 21, 2020, 10:11:00 pm by pvo »

Tatjana Dubrovica

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 268
    • View Profile
Re: vmgr.nsm connection to VMware vCenter server
« Reply #1 on: May 25, 2020, 03:31:20 pm »
Currently the bet option to find problems in credentials is to use virsh tool. Something like this:
virsh -c esx: //root@vcenter. mydomain.local/?no_verify=1 list

This tool will give more information about the problem that occurred wile connection.

pvo

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: vmgr.nsm connection to VMware vCenter server
« Reply #2 on: May 25, 2020, 03:55:32 pm »
The answer is as I expected.

Code: [Select]
error: failed to connect to the hypervisor
error: internal error: Expecting 'vcenter.mydomain.local' to be a ESX(i) host but found a vCenter/VPX host

Thank you for your help.

pvo

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: vmgr.nsm connection to VMware vCenter server
« Reply #3 on: May 25, 2020, 04:09:18 pm »
This works fine:
Code: [Select]
virsh -c vpx://root@vcenter.mydomain.local/Datacenter_name/Cluster_name/ESXi_Server_name?no_verify=1
But it means I need one connection for each ESXi server and not one common connection for whole Cluster or for whole vCenter.
« Last Edit: May 25, 2020, 04:35:59 pm by pvo »

Filipp Sudanov

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 285
    • View Profile
Re: vmgr.nsm connection to VMware vCenter server
« Reply #4 on: May 25, 2020, 06:56:12 pm »
libvirt claims that it can connect to vcencter, not only particular ESXi servers.

Here's a video that seems to be explaining how this is done: https://www.youtube.com/watch?v=n3XJ0X1l9DU

pvo

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: vmgr.nsm connection to VMware vCenter server
« Reply #5 on: May 25, 2020, 08:55:46 pm »
The video uses the same URL format I described above. The URL connects to vCenter server, but the connection is restricted to a single ESXi server.

Following is written in the libvirt documentation https://libvirt.org/drvesx.html
"A vpx:// connection is currently restricted to a single ESX server. This might be relaxed in the future. The path part of the URI is used to specify the datacenter and the ESX server in it. If the ESX server is part of a cluster then the cluster has to be specified too."

This means that if I list all VMs I see only the VMs on this single ESXi server. If a running VM is moved to another ESXi server in the same cluster it disappears form the list and appears in the list for  the other ESXi server which needs another connection to the same vCenter but with different path. I'm not sure it will be possible to identify, that it is the same VM and move the DCIs instead of deleting old and creating new ones.

I know than this is property of livirt and it must be changed there but it limits the VMware monitoring in NetXMS.

Victor Kirhenshtein

  • Lead Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 7036
    • View Profile
Re: vmgr.nsm connection to VMware vCenter server
« Reply #6 on: May 27, 2020, 07:26:05 am »
Actually we already decided that we have to move from libvirt to direct interaction with VMWare API (as we already did for XEN) - it's just question of available time and resources.

Best regards,
Victor

it_user1

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: vmgr.nsm connection to VMware vCenter server
« Reply #7 on: June 03, 2020, 05:23:18 pm »
Actually we already decided that we have to move from libvirt to direct interaction with VMWare API (as we already did for XEN) - it's just question of available time and resources.

Best regards,
Victor

hi, with version 3.3 is possible use vmware api? if yes where i can find documentation?

thanks

Andrea

Filipp Sudanov

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 285
    • View Profile
Re: vmgr.nsm connection to VMware vCenter server
« Reply #8 on: June 03, 2020, 09:11:19 pm »
Working with VMWare API in in future plans only. It's not implemented yet.