PowerOn VM with NIC disabled

  • 15 December 2017
  • 4 replies

Userlevel 1
Badge +9
Is there the possibility to run a VM by Command line with the NIC disabled?

4 replies

Userlevel 3
Badge +19
I am not sure there is any option to disable the NIC, not that I am aware of, generally, if you clone VM you will have different MAC address, in case you need to isolate VM for whatever reason generally what I do is:
1) create a new network in the prism with non-existent VLAN ID
2) attach that VM to that network from acli.
To list VM details
acli vm.get
To update VM NIC
acli vm.nic_update network=

You can try the micro-segmentation feature to quarantine particular VM from Prism Central.
Hope that works for you.
Userlevel 2
Badge +4
Is there an equivalent powershell command to perform this on AHV?
You can delete nic with :

PS > $vmId = (Get-NTNXVM | where {$_.vmName -eq "MyVM"}).uuid
PS > $nicId= (Get-NTNXNetwork | where {$_.name -eq "MyNic"}).uuid
PS > Remove-NTNXVMNIC -Vmid $vmId -Nicid $nicId

And Add with :

# Create Spec Nic and get nic ID
$nic = New-NTNXObject -Name VMNicSpecDTO
$nic_info = Get-NTNXNetwork | where {$_.name -eq "MyNic"}
$nic.networkUuid = ($nic_info.uuid)

# Attach nic to VM
Add-NTNXVMNic -Vmid $vmId -SpecList $nic
Edit :

To delete nic :

PS > $vmId = (Get-NTNXVM | where {$_.vmName -eq "MyVM"}).uuid
PS > $nicId = (Get-NTNXVMNIC -Vmid $vmId).macAddress
PS > $Remove-NTNXVMNIC -Vmid $vmId -Nicid $nicId