node-vsphere-soap icon indicating copy to clipboard operation
node-vsphere-soap copied to clipboard

self.client.VimService.VimPort is not a function

Open DrFatalis opened this issue 9 years ago • 2 comments

Hi everyone,

Got an issue with VimService.VimPort which is not found as method. It seems to be OK to connect to ESX Host but when I try to put command line to list all vms....it fails !

Do you have an idea (I am under windows server 2008 r2)?

image

DrFatalis avatar Jan 17 '16 15:01 DrFatalis

Do you have an excerpt of the code that calls the node-vsphere functions? I intended people to use node-vsphere which depends upon node-vsphere-soap

reedog117 avatar Jan 18 '16 05:01 reedog117

Here is the excerpt of my code. I've downloaded your package this weekend, I've just tried this simple thing:

/********************************************************************************************************/

var nvs = require('node-vsphere-soap'); var Code = require('code'); var Lab = require('lab'); var util = require('util'); /var lab = exports.lab = Lab.script();/ var config = require('node-vsphere-soap/config-esx.js').esxConfig var _ = require('lodash'); ...

var esxListVMs = function esxListVMs() { var vCmd = vc.runCommand('vim-cmd vmsvc/getallvms'); vCmd.once( 'result', function(result, raw, soapHeader){ console.log(result); }); vCmd.once('error', function(err){ console.log(err); }); }

var esxConnect = function esxConnect() { vc = new nvs.Client(config.host, config.user, config.password, config.sslVerify); vc.once('ready', function() { // perform work here console.log('Connection established with ESX server on ' + config.host); esxListVMs(); }); vc.once('error', function(err) { // handle error here console.log('Connection failed.'); }); }

esxConnect();

DrFatalis avatar Jan 18 '16 06:01 DrFatalis