At some point you may have some nim machine definition with allocated resources. If you attempt to remove the nim machine definition you may encounter errors, and the nim removal will fail. Below is an example provided, and how to go about de-allocating and delete the NIM resources.
# nim -o remove my_vio1_server
0042-001: nim: processing error encountered on "master":
0042-037: r_rmmac: the state of "my_vio1_server" prevents this operation from succeeding.
By looking at the definition of the machine:
# lsnim -l my_vio1_server
my_vio1_server:
class = machines
type = standalone
connect = nimsh
platform = chrp
netboot_kernel = 64
if1 = network1 my_vio1_server 0a1293c7de49
cable_type1 = tp
Cstate = BOS installation has been enabled
prev_state = ready for a NIM operation
Mstate = not running
boot = boot
bosinst_data = vio_31125_bosinst_data
mksysb = vio_31125_mksysb
nim_script = nim_script
spot = vio_31125_spot
control = master
err_info = warning: 0042-006 m_bos_inst: (From_Master) connect A remote host did not respond within the timeout period. warning: 0042-134 m_bos_inst: unable to initiate network boot on "my_vio1_server"
Now as the last operation was an error, you have to fix that up by running: nim -o reset my_vio1_server
and after you do a lsnim -l my_vio1_server again, you’ll see that the err_info line is non-existant.
The next step is to de-allocate the resources.
# nim -o deallocate -a bosinst_data=vio_31125_bosinst_data my_vio1_server
warning: 0042-9001 m_deallocate: processing error encountered on "master":
0042-175 c_ch_nfsexp: An unexpected result was returned by the "/usr/sbin/exportfs" command:
exportfs: /export/bosinst_data/vio_31125_bosinst_data/bosinst.data: A file or directory in the path does not exist.
Ignore the error, once the resource has been deallocated, it can be removed with: nim -o remove vio_31125_bosinst_data
You will repeat the deallocate and remove for the mksysb and spot, followed by the nim client definition itself like:
nim -o deallocate -a spot=vio_31125_spot my_vio1_server
nim -o deallocate -a mksysb=vio_31125_mksysb
nim -o remove my_vio1_server