SMARTS: using the ASL delete() function doesn't remove the components of the selected instances
search cancel

SMARTS: using the ASL delete() function doesn't remove the components of the selected instances

book

Article ID: 331628

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

Symptoms:


ASL script is not working as expected.

delete() function in ASL scripts does not remove all components of the selected instances

Environment

VMware Smart Assurance - SMARTS

Cause

The wrong ASL function delete() is used.

Resolution

Use the remove() function instead of delete().

Please see sample asl script below which will iterate through the UnitaryComputerSystem Superclass and perform a remove() on each instance found.

To run this script, use the sm_adapter command:
./sm_adapter -s <DomainName> <FullPathToScript>
 
START() {
.. eol
}
do {
foreach Obj (getInstances("UnitaryComputerSystem")) { // Gets all the UCS instances in the topology
UCSObj = object(Obj);
print(UCSObj->Name);
UCSObj->remove();
}

print("Done dumping all the UCS Instances");
}		


Additional Information

Please see the ASL reference guide for more information on ASL scripting