2

I have an ESXi 6.7u3 server which is running pfSense for my network. The problem is, I need to change this VMs network adapter, which connects the pfSense instance to the other VMs while bridged to a physical NIC for LAN.

So, if I power off the VM, I lose connectivity from LAN to the vmnic, other VMs and the management network.

I was hoping that I could do the change and it would be applied on next restart of the VM, but no. I think I also could reset the management network to the builtin NIC on the motherboard, but I had some issues getting the management interface back to the vmnic the last time, so I'd prefer to keep it as is.

Can I use esxcli to do this change locally?

1 Answer 1

1

You don't need to to power off your VM to change the network, you can do that while it's running.

But to be on the safe side, you can also do this:

  • Enable the ESXi Shell
    • Customize System -> Troubleshooting options -> Enable ESXi Shell
  • switch to the management console on the local console of the host (alt+f1)
  • log in
  • go to the VM directory

    cd /vmfs/volumes/datastore/vmname/
    
  • get the VM World id and shutdown the VM

    esxcli vm process list
    esxcli vm process kill –type=[soft,hard,force] –world-id=<WorldID>
    
  • make a backup of the .vmx file

    cp vmname.vmx vmname.vmx.bak
    
  • Edit the .vmx file (vi is available)

    vi vmname.vmx
    
  • start the VM

    vim-cmd vmsvc/getallvms |grep vmname
    vim-cmd vmsvc/power.on <vmid>
    
1
  • Thanks for the CLI info, I'll try this later today when I can afford some downtime! I tried to change the network on the fly, but I get this warning: Failed to reconfigure virtual machine pfsense. The attempted operation cannot be performed in the current state (Powered on). May 14, 2020 at 6:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .