Your vm is a vCloud:VM.
You need to get it converted to a VC:virtualMachine using the linked code before doing var host = vm.sdkConnection;
Your vm is a vCloud:VM.
You need to get it converted to a VC:virtualMachine using the linked code before doing var host = vm.sdkConnection;