Automation

 View Only
  • 1.  Trying to use New-VMHostRoute

    Posted Oct 01, 2010 09:23 PM

    Been looking to route the VMKernal traffic to different gateways based on the adapters we have set up. I found this blog entry and was working my way through it.

    Enhanced VMkernel Networking Configuration in vSphere PowerCLI 4.1

    Everything is fine until I get to the point of creating the "New-VMHostRoute" parts. At that point I get an error:

    -


    New-VMHostRoute : 10/1/2010 2:58:11 PM New-VMHostRoute An error occur

    red during host configuration.

    At line:1 char:16

    + New-VMHostRoute <<<< -Destination '192.168.1.0' -PrefixLength 22 -Gateway '192.168.1.1'

    + CategoryInfo : NotSpecified: (:smileyhappy: , VimExceptio

    n

    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomatio

    n.ViCore.Cmdlets.Commands.Host.NewVMHostRoute

    -


    I moved on to try a few of the "Set-VMHostRoute" commands and I get a similiar thing. If I intentionally create a syntax error I do not get the comfirmation prompt, so I think my syntax is correct. They all seem to have an error on the space right after the initial command and there is no reference to anything more being needed in the examples. Any help or reference you can point me at would be appreciated.

    edit: I had left out the ip initially forgetting to put in just dummy ones so you can see how exactly I had put in the command. Sorry about that.

    Message was edited by: Argonak



  • 2.  RE: Trying to use New-VMHostRoute

    Posted Oct 01, 2010 09:49 PM

    I think the error comes from the -Destination parameter you use.

    This parameter should have a destination IP address, not an empty string. The meaningful bits are determined by the -PrefixLength parameter.

    And the -Gateway parameter should also have a valid gateway IP address, not an empty string.

    Something like

    Get-VMHost <hostname> | New-VMHostRoute -Destination 192.168.1.0 -PrefixLength 24 -Gateway 192.168.1.254
    

    One thing to watch out for, you have to specify a valid gateway IP address otherwise you will get that same error.

    ____________

    Blog: LucD notes

    Twitter: lucd22



  • 3.  RE: Trying to use New-VMHostRoute

    Posted Oct 01, 2010 10:22 PM

    As in my edit above, sorry for not showing that I did have information in the -Destination and -Gateway parameters.

    I double checked and the gateway is reachable from the host as well as the prefix is correct with my 255.255.252.0 subnet. The error is always the same depending on the cmdlet I am using. The error "At line:1 char:16" will change to point at the space right after the cmdlet along with the '<<<'.



  • 4.  RE: Trying to use New-VMHostRoute

    Posted Oct 01, 2010 11:09 PM

    You do pass a VMHost to the cmdlet ?

    Like this

    Get-VMHost <hostname> | New-VMHostRoute -Destination "10.0.0.0" -PrefixLength 16 -Gateway 192.168.111.2
    

    or this

    New-VMHostRoute -VMHost (Get-VMHost <hostname> -Destination "10.0.0.0" -PrefixLength 16 -Gateway 192.168.111.2
    

    If I leave out the VMHost I get the same error you get.

    ____________

    Blog: LucD notes

    Twitter: lucd22



  • 5.  RE: Trying to use New-VMHostRoute

    Posted Oct 01, 2010 11:32 PM

    Thank you for the examples and suggestions.

    I had not tried to pass a VMHost before. My error never said that it was missing a host like yours does. when I do pass the VMHost like in your examples I get the same error as I did before. It says it is an error during host configuration.



  • 6.  RE: Trying to use New-VMHostRoute
    Best Answer

    Posted Oct 01, 2010 11:57 PM

    Oops, didn't compare your error message correctly with what I got.

    Stupid question perhaps, since you don't get an error on the missing VMHost, I conclude that your are connected to an ESX(i) host and not a vCenter Server. Correct ?

    Is that perhaps an ESXi server ?

    The New-VMHostRoute cmdlet reference states that the cmdlet is only supported on vCenter and ESX, not ESXi.

    ____________

    Blog: LucD notes

    Twitter: lucd22