ClusterLabs / anvil

The Anvil! Intelligent Availability™ Platform, mark 3
5 stars 6 forks source link

Add the ability to un/plug `vnetX` devices to `anvil-manage-server-system`. #740

Open digimer opened 2 months ago

digimer commented 2 months ago

This is a frequently used task with a lot of our users, we need to add support for it to the UI. Once the back-end is done, hand over to @ylei-tsubame for UI integration.

digimer commented 1 month ago

The back-end is ready for testing.

digimer commented 1 week ago

Confirmed manually to be working.

digimer commented 1 week ago

For the tests, call anvil-manage-server-network --server <server_uuid> --mac 52:54:00:aa:bb:cc --unplug and then wait for the output from virsh dumpxml <server_name> to show:

    <interface type='bridge'>
      <mac address='52:54:00:aa:bb:cc'/>
      <source bridge='ifn1_bridge1'/>
      <target dev='vnet1'/>
      <model type='virtio'/>
      <link state='down'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

Key is <link state='down'/>. Then call again with --plug and wait for that to either change to <link state='up'/> or for the link state element to disappear.