Wednesday, March 5, 2014

Deleting VDOMs

VDOMs have quite a number of dependencies that need to be deleted before you can get rid of the VDOM itself. Below is a useful little script that goes through all the sections and purges them so the VDOM can be deleted. Adjust it as needed.

## This script needs to be run interactively. In other words you cannot copy and paste the whole script. You have to acknowledge each purge command.
## Purge all VDOM specific configuration


config vdom
 edit <vdomname>
 config firewall policy
  purge
 end
 config firewall policy6
  purge
 end
 config firewall vipgrp
  purge
 end
 config firewall vip
  purge
 end
 config firewall addrgrp
  purge
 end
 config firewall address
  purge
 end
 config router static
  purge
 end
end

## Assign any interfaces used by the VDOM back to ROOT

config global
 config system interface
    edit <interface name>
    set vdom root
 end
end

## Delete any VDOM Links

config system global
 config system vdom-link
    delete <vdom link name>
 end
end  

## Make sure all admins are assigned to the root VDOM

config system global
 config system admin
  edit <admin-name>
  set vdom root
  end
 end

config vdom
 delete <vdomname>
end

2 comments:

egroeper said...

Interesting.
I didn't need to delete addresses or addressgroups.
But I had to delete the zones of that vdom, to be able to delete the interfaces.

"diag sys checkused" helps a lot to find out what you need to delete.

Unknown said...

You can also put a line after purge with just a y like this:

config firewall policy
purge
y
end

and then you should be able to paste.