PowerCLI

 View Only
  • 1.  Set Network Coredump Settings with PowerCLI Problem

    Posted Oct 24, 2011 01:35 AM

    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:
    1. Open a console session to the ESXi host, the vMA, or other location where the vCLI is installed.
    2. 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
    3. Enable the network coredump configuration using this command:
      esxcli system coredump network set --enable true
    4. 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



  • 2.  RE: Set Network Coredump Settings with PowerCLI Problem
    Best Answer

    Posted Nov 19, 2011 09:11 AM

    hi.

    this code work for me:

    $esxcli.system.coredump.network.set($null,"vmk0","192.168.22.250",6500)
    $esxcli.system.coredump.network.set(1)
    $esxcli.system.coredump.network.get()



  • 3.  RE: Set Network Coredump Settings with PowerCLI Problem

    Posted Nov 21, 2011 02:53 PM

    michigun,

    Thank you so much for replying and especially with the exact code. It works perfectly. I will now be able to use this in my build scripts.

    Cheers!



  • 4.  RE: Set Network Coredump Settings with PowerCLI Problem

    Posted Jun 25, 2012 04:17 PM

    Hello,

    i still get the 503 Error. (esxi5 U1)

    So the same Error like for the Unclaiming stuff.

    theire was a hidden Api for Unclaiming.

    ha-cli-handler-corestorage-claimrule

    Anybody knows if that is also available for the Network stuff?

    thx

    Max



  • 5.  RE: Set Network Coredump Settings with PowerCLI Problem

    Posted Jun 25, 2012 06:10 PM

    ah i found it.

    $esxcli.TypeManager.QueryMoInstances($null)

    with that i found the Coredump stuff :smileywink:.

    ha-cli-handler-system-coredump-network

    strange over https://  i could manage it.

    but over powercli i still get the damned 530 error ;(

    Maybe any hints?

    thx

    Max