I want to use PowerCLI to set my vSphere 5.0 hosts so that they do a coredump to my vCenter server. I have a vCenter server setup with the ESXi Dump Collector installed. I am familiar with using the local CLI and RCLI to set these settings but I want to use PowerCLI.
I make a variable called $esxcli. $esxcli = Get-EsxCli -VMHost host1
Then $esxcli.system.coredump.network yields the following:
PowerCLI C:\> $esxcli.system.coredump.network
===============================
EsxCliElement: coredump.network
Methods:
--------
NetworkCoredump get()
boolean set(boolean enable, string interfacename, string serveripv4, long serverport)
If I attempt to use the set command I get an error 500 internal server error. See the following:
PowerCLI C:\> $esxcli.system.coredump.network.set(1,"vmk0","192.168.1.220",6500)
The remote server returned an error: (500) Internal Server Error.
At line:1 char:36
+ $esxcli.system.coredump.network.set <<<< (1,"vmk0","192.168.1.220",6500)
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodInvocationException
I have tried putting the port number in quotes as well as removing quotes from all of the fields and it always returns the same error.
I relented and used the vMA to set the settings on the hosts. When I run the $esxcli.system.coredump.network.get() command I see the settings that I entered. I am also able to use $esxcli.system.coredump.network.set(1) or $esxcli.system.coredump.network.set(0) which will enable or disable the network coredump function. However, I want to be able to use PowerCLI to set all of the settings and enable the function.
The syntax for setting this with the local esxcli comman is listed here at the following link. It first has us setting the interface, server IP and port number. After those settings are set then we use another command to enable the function.
http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=2002955
To configure using ESXCLI:
- Open a console session to the ESXi host, the vMA, or other location where the vCLI is installed.
- Review the current configuration using this command:
esxcli system coredump network get
Specify the VMkernel network interface to use for outbound traffic and the IP address and UDP port number of the remote network coredump server using this command:
esxcli system coredump network set --interface-name <VMkernelInterface> --server-ipv4 <IPAddress> --server-port PortNumber
Example:
esxcli system coredump network set --interface-name vmk0 --server-ipv4 10.11.12.13 --server-port 6500
- Enable the network coredump configuration using this command:
esxcli system coredump network set --enable true
- Review and confirm the configuration using this command:
esxcli system coredump network get
Any help with this would be greatly appreciated. I like to use PowerCLI to do automated builds and keep my configurations consitent. Many of my clients do not use Enterprise + so we cannot use host profiles.
Thanks again.
Andrew