For the record, the cleanup workaround for MAAS <= 3.2 is
Run ``` sudo snap run --shell maas.supervisor -c "maas-region shell" ```
and then execute
``` from maasserver.enum import INTERFACE_TYPE, IPADDRESS_TYPE from maasserver.models import Interface
interfaces = Interface.objects.filter(type=INTERFACE_TYPE.UNKNOWN,ip_addresses__ip__isnull=True,ip_addresses__alloc_type=IPADDRESS_TYPE.DISCOVERED,) len_interfaces = len(interfaces) for index, interface in enumerate(interfaces): print(f"\rDeleting interface {index}/{len_interfaces}", end="") interface.delete()
print("") ```
It will take several minutes/hours depending on the amount of zombie resources you have
For the record, the cleanup workaround for MAAS <= 3.2 is
Run
```
sudo snap run --shell maas.supervisor -c "maas-region shell"
```
and then execute
```
from maasserver.enum import INTERFACE_TYPE, IPADDRESS_TYPE
from maasserver.models import Interface
interfaces = Interface. objects. filter( type=INTERFACE_ TYPE.UNKNOWN, ip_addresses_ _ip__isnull= True,ip_ addresses_ _alloc_ type=IPADDRESS_ TYPE.DISCOVERED ,) interfaces) : f"\rDeleting interface {index} /{len_interface s}", end="") delete( )
len_interfaces = len(interfaces)
for index, interface in enumerate(
print(
interface.
print("")
```
It will take several minutes/hours depending on the amount of zombie resources you have