Exclude Virtual Servers from Creating Assets

tschenke
Giga Contributor

I need to exclude virutal machines from being created as assets.   I have added && current.virutal != TRUE to the end of the condition that was already in place in the Create Asset on insert business rule. (current.asset.nil()   || (current.asset.ci != current.sys_id) && current.virtual != TRUE) and the VMs were still added.   I replaced the current.virtual with current.manufacturer != 'VMWare, Inc.' and that didn't work either.   I'm fairly new to javascript but it seems to me that this should work?   Does anyone have any suggestions or input as to why it's not working?   Thanks.

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Tony Schenke



Can you please try the below and let me know the outcome


((current.asset.nil())   || (current.asset.ci != current.sys_id)) && (!current.virtual == true )


View solution in original post

5 REPLIES 5

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Tony Schenke



Can you please try the below and let me know the outcome


((current.asset.nil())   || (current.asset.ci != current.sys_id)) && (!current.virtual == true )


That worked when I updated CI's.   However, if I go to the Model Category and lick the Create Assets button, it still creates VM Assets.   I'm guessing I'd need to add the same line to the UI Action.



That may have been the only configuration that I didn't try yet.   Thanks for the quick response.


tschenke
Giga Contributor

After checking back again, that didn't work.   I now have all the VMs back as hardware assets.   Back to the drawing board.


Community Alums
Not applicable

Tony,


I'm sorry I did not see this earlier. Have you resolved this yet?



If not, take a lookat the Model assigned to the VMs that are discovered. It should be a Virtual Machine Model of some sort. In the Model record, you can set the Asset tracking strategy to Don't create assets. That will override the Model Category creation of the assets for the virtual CIs you discover.



Ben