Ops Manager returns "500 An error occurred" after creating custom VM types and removing them
search cancel

Ops Manager returns "500 An error occurred" after creating custom VM types and removing them

book

Article ID: 293684

calendar_today

Updated On:

Products

Operations Manager

Issue/Introduction

Suppose that you create your custom VM types and remove them with using Ops Manager API as shown below:
$ uaac curl https://<OpsMan-Hostname>/api/v0/vm_types -X PUT -H "Content-Type: application/json" -d '
{
  "vm_types": [
   ............. 
   ............. 
   .............
  ]
 }' -k
  :
$ uaac curl https://<OpsMan-Hostname>/api/v0/vm_types -X DELETE

After that, if you access Ops Manager from your Web browser, then you will encounter the error page with the following types of error messages:
500 An error occurred.
Contact Pivotal Technical Support to report the problem.

Back to dashboard

ActionView::Template::Error

undefined method `cpu' for nil:NilClass

/home/tempest-web/tempest/web/app/models/persistence/models/job.rb:355:in `assign_primitive_resources!'
/home/tempest-web/tempest/web/app/models/persistence/models/job.rb:180:in `resources_valid?'
  :


Environment

Product Version: 2.7

Resolution

You need to bring back the default VM types after removing custom VM types by following the "Remove Custom VM_TYPE" section in the article below:
 

If you don't record the default VM types in JSON format to bring back, you can get them with the following REST API call right after removing custom VM types:

$ uaac curl https://<OpsMan-Hostname>/api/v0/vm_types -k