VMware Cloud Community
oasisinin
Enthusiast
Enthusiast

Syslog Server Power CLI

PS > Set-VMHostSysLogServer -SysLogServer "1.1.1.1" -VMHost ESXiHost.local

Set-VMHostSysLogServer : 12/6/2013 2:05:29 PM    Set-VMHostSysLogServer        Unable to get objects by name: server "ESXiHost.local" not connected.   

At line:1 char:23

+ Set-VMHostSysLogServer <<<<  -SysLogServer "1.1.1.1" -VMHost ESXiHost.local

    + CategoryInfo          : InvalidResult: (ESXiHost.local:VIServerImpl) [Set-VMHostSysLogServer], ViServerConnectionException

    + FullyQualifiedErrorId : Core_ObnSelector_GetConnectionListForObnParameter_InvalidServer,VMware.VimAutomation.ViCore.Cmdlets.Commands.

   Host.SetVMHostSysLogServer

what am I missing or doing wrong?

BTW, the esxi hosts in question is well connected

0 Kudos
7 Replies
LucD
Leadership
Leadership

Looks like you didn't do a Connect-VIServer.

Check if there is anything in $defaultviservers


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
oasisinin
Enthusiast
Enthusiast

the command was executed after

Connect-VIServer <VIserver>

Sorry for not making it clear earlier

0 Kudos
LucD
Leadership
Leadership

Is

Get-VMHost -Name ESXiHost.local

returning anything ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
oasisinin
Enthusiast
Enthusiast

here is the response after running above command

Get-VMHost : 12/9/2013 8:33:44 AM    Get-VMHost        Server ESXiHost.local is not connected.  

At line:1 char:11

+ Get-VMHost <<<<  -Name ESXiHost.local

    + CategoryInfo          : InvalidArgument: (:) [Get-VMHost], ViServerConnectionException

    + FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_TryVerifyIsConnected_NotConnected,VMware.VimAutomation.ViCore.Cmdle

   ts.Commands.GetVMHost

Name                 ConnectionState PowerState NumCpu CpuUsageMhz CpuTotalMhz   MemoryUsageGB   MemoryTotalGB Version

----                 --------------- ---------- ------ ----------- -----------   -------------   ------------- -------

ESXiHost.local... Connected       PoweredOn       2          60        5332           1.182           4.000   5.5.0

says its not connected then at the bottom it says its "Connected" :smileyplain:

0 Kudos
LucD
Leadership
Leadership

Is it possible you have more than 1 connection open ?

Do a

$defaultviservers

Is there more than 1 entry in there ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
oasisinin
Enthusiast
Enthusiast

it shows three connections

Name                           Port  User                         

----                           ----  ----                         

Virtual Center                  443   DOMAIN\user          

ESXiHost.local               443   root                         

ESXi2Host.local             443   root                         

0 Kudos
LucD
Leadership
Leadership

Try to disconnect the 2 connections to the ESXi servers, and only keep the vCenter connection.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference