Automation

 View Only
  • 1.  Manage Firwall VAMI with PowerCLI

    Posted Nov 06, 2023 11:57 AM

    Hello

    it's possible to add a list of network in VAMI in bulk using PowerCLI?



  • 2.  RE: Manage Firwall VAMI with PowerCLI

    Posted Nov 06, 2023 01:13 PM

    Do you mean if PowerCLI has cmdlets to configure the networks on the VCSA appliance?
    If that is what you ask, no there are no such cmdlets.

    But there other ways to call the vami_config_net cli if that is what you mean.
    The VCSA has the VMware Tools installed, so you could use Invoke-VMSCript.
    Or use the  Posh-SSH module to use an SSH connection to the VCSA to execute said cli.



  • 3.  RE: Manage Firwall VAMI with PowerCLI

    Posted Nov 06, 2023 01:17 PM

    thanks LucD

    Yep I mean the way 2 call VAMI  but I'm unsure about that. Can you provide me with some guidance?



  • 4.  RE: Manage Firwall VAMI with PowerCLI

    Posted Nov 06, 2023 01:20 PM

    Not sure what you mean by "guidance", it is either basic usage of the Invoke-VMScript cmdlet or basic usage of the Posh-SSH cmdlets.
    For the latter, I have a short example in Use Posh-SSH instead of PuTTY



  • 5.  RE: Manage Firwall VAMI with PowerCLI

    Posted Nov 06, 2023 01:28 PM

    Please accept my apologies, I misspoke.

    Can you give me a hand to add the bulk IP list?



  • 6.  RE: Manage Firwall VAMI with PowerCLI

    Posted Nov 06, 2023 01:54 PM

    Which vami_config_net command do you want to run through PowerCLI?



  • 7.  RE: Manage Firwall VAMI with PowerCLI

    Posted Nov 06, 2023 02:23 PM

    I just check vmware documentation regarding vami_config_net and i didn't find the information related to firewall so honestly not sure how to tacle this.



  • 8.  RE: Manage Firwall VAMI with PowerCLI

    Posted Nov 06, 2023 02:52 PM

    I suspect the only way in that case would be to edit the firewall.conf file (with sed).
    That can be done with Invvoke-VMScript or through an SSH session.



  • 9.  RE: Manage Firwall VAMI with PowerCLI

    Posted Nov 06, 2023 05:56 PM

    then, I will try to learn about Invvoke-VMScript,  



  • 10.  RE: Manage Firwall VAMI with PowerCLI
    Best Answer

    Posted Nov 06, 2023 06:10 PM

    You might want to have a look at Solved: Re: Invoke-VMScript. Pass variable in BASH - VMware Technology Network VMTN as an example on how to use Invoke-VMScript on a Linux box and use the sed to change a file on there.



  • 11.  RE: Manage Firwall VAMI with PowerCLI

    Posted Nov 06, 2023 07:06 PM

    Thank you