No returned value for command 'shutdown'
Hello,
vShpere version : 5.5
node version : 6.9.5 (LTS)
I've been using the example provided in the Readme to execute some vSphere commands.
However, instead of using 'powerOff' command to powerOff my VM, I tried using 'shutdown' so that guest OS is properly powered off. The command is correctly executed by vSphere, but the code in the function powerOpVMByMORef fails to run properly because the result from the runCommand doesn't return anything else than an empty object. So there is no (vSphere) task to wait for.
I've been able to check that it is most probably the expected behaviour according to vSphere 5.5. I didn't take the time to check for other versions.
I'm not sure about what to do here : I've made some modifications on my forked repo which fit my needs but I'm not sure this is the right way to handle this.
The most surprising thing for me is that you're testing the shutdown command in your tests.
I tried running them and they also failed the same way.
So you should probably have encountered this problem already. Unless tests weren't working ? Or is it due to me using newer versions of the dependencies ?
In case it could be useful, I'm attaching the error log I encountered when running your tests on a unique Win7 VM.
➜ node-vsphere git:(master) ✗ npm test
> [email protected] test /[ my own path]/node-vsphere
> lab
........xx
Failed tests:
9) Client tests - VM power operations: powers on and off a VM (by name):
Cannot read property 'attributes' of undefined
at Client.<anonymous> (/[ my own path]/node-vsphere/lib/client.js:396:18)
at Client.g (events.js:291:16)
at emitNone (events.js:86:13)
at Client.emit (events.js:185:7)
at EventEmitter.<anonymous> (/[ my own path]/node-vsphere/node_modules/node-vsphere-soap/lib/client.js:173:14)
at EventEmitter.g (events.js:291:16)
at emitThree (events.js:116:13)
at EventEmitter.emit (events.js:194:7)
at /[ my own path]/node-vsphere/node_modules/node-vsphere-soap/lib/client.js:98:15
at /[ my own path]/node-vsphere/node_modules/soap/lib/client.js:130:7
at /[ my own path]/node-vsphere/node_modules/soap/lib/client.js:248:7
at Request._callback (/[ my own path]/node-vsphere/node_modules/soap/lib/http.js:60:7)
at Request.self.callback (/[ my own path]/node-vsphere/node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (/[ my own path]/node-vsphere/node_modules/request/request.js:1081:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (/[ my own path]/node-vsphere/node_modules/request/request.js:1001:12)
at IncomingMessage.g (events.js:291:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
10) Client tests - VM power operations: powers on and off multiple VMs (by array of names):
Cannot read property 'attributes' of undefined
at Client.<anonymous> (/[ my own path]/node-vsphere/lib/client.js:396:18)
at Client.g (events.js:291:16)
at emitNone (events.js:86:13)
at Client.emit (events.js:185:7)
at EventEmitter.<anonymous> (/[ my own path]/node-vsphere/node_modules/node-vsphere-soap/lib/client.js:173:14)
at EventEmitter.g (events.js:291:16)
at emitThree (events.js:116:13)
at EventEmitter.emit (events.js:194:7)
at /[ my own path]/node-vsphere/node_modules/node-vsphere-soap/lib/client.js:98:15
at /[ my own path]/node-vsphere/node_modules/soap/lib/client.js:130:7
at /[ my own path]/node-vsphere/node_modules/soap/lib/client.js:248:7
at Request._callback (/[ my own path]/node-vsphere/node_modules/soap/lib/http.js:60:7)
at Request.self.callback (/[ my own path]/node-vsphere/node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (/[ my own path]/node-vsphere/node_modules/request/request.js:1081:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (/[ my own path]/node-vsphere/node_modules/request/request.js:1001:12)
at IncomingMessage.g (events.js:291:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
2 of 10 tests failed
Test duration: 1835 ms
The following leaks were detected:Reflect
npm ERR! Test failed. See above for more details.
I'm pretty sure the tests were working when I wrote them, so I'm not sure what has changed since then... This is going to require some further investigation.