vmware-archive / powernsx

PowerShell module that abstracts the VMware NSX-v API to a set of easily used PowerShell functions
173 stars 90 forks source link

Change DLR Hostname #450

Open dumlutimuralp opened 6 years ago

dumlutimuralp commented 6 years ago

Could not find the cmdlet for changing the hostname of DLR. This is needed by a customer to make sure that the CLI Prompt in SSH session reflects the correct component.

alagoutte commented 6 years ago

Hi @dumlutimuralp

There is no cmdlet yet for this...

but you can use $esg = Get-NsxEdge MyEdge $esg.name = "NewName" $esg | set-nsxedge (-Confirm:$true)

May be need also to update FQDN

hakkurt commented 6 years ago

As I know, you can set hostname while you're creating ESG. But there is no such a parameter for DLR yet. I'm using following code for DLR.

$Ldr = Get-NsxLogicalRouter -name $DLRName $Ldr.fqdn=$DLRName $Ldr | Set-NsxLogicalRouter -confirm:$false | out-null

alagoutte commented 6 years ago

Oups, yes need to use LogicalRouter and not Edge...

hakkurt commented 6 years ago

By the way, is there any way to forcesync an ESG or DLR via PowerNSX ?

alagoutte commented 6 years ago

For ESG : Get-NsxEdge Edge01 | Repair-NsxEdge -Operation ReSync -Confirm:$false

But there is not (yet) Repair-NsxLogicalRouter...