Unable to change VM config in vCloud Director 9.7 error: “class: java.lang.NullPointerException”
The following error message was shown in the vCloud director GUI after trying to modify the VM: “class: java.lang.NullPointerException”. The issue occurred on every VM configuration update such as: edit description, changing resources etc.
Troubleshooting on vCD layer
I tried to find some additional logs by logging into the vCD cells and searching for the JOB ID that was mentioned in the error view “class: java.lang.NullPointerException”. Unfortunately, I couldn’t find any logs that contained the failed job ID. The following error event was logged after the failed task.
There are two easy troubleshooting steps that can be performed when you have an issue with a VM that cannot be updated in vCD.
I’m referring to a simple VM config update and a refresh of the vCenter inventory in vCD. I have already described how to perform these task in one of my previous article: URL. Unfortunately, these steps didn’t fixed my issue this time.
Troubleshooting on SQL layer
Please be advised that on this part with the queries mentioned below, we will not change anything in the database. We are just going to query the database, to see if we can find out what might be off in the database. Open the Microsoft SQL management server and use query below to find out which resourcepool has been registered in the org_prov_vdc table for the OrgvDC that is having the issue. Make a note of the sub_rp_moref.
select * from org_prov_vdc where name = 'OrgvDC-Name'
Let’s search in the vrp_rp table for a resourcepool that matches the same sub_rp_moref value. Use the following query to do so.
select * from vrp_rp where sub_rp_moref = 'resgroup-384052'
It looks like the resourcepool with sub_rp_moref value “resgroup-384052” doesn’t exists. Let’s use the vCenter MOB (Managed object browser) to validate that. Open https://vcenter-fqdn/mob and login with the native administrator credentials to access the MOB.
Once logged in MOB use the following URL with the resourcepool value we have noted earlier: https://vcenter-fqdn/mob/moid=resgroup-384052
We will now query the resource_pool_inv table to find the correct resourcepool value. Make a note of the moref value.
select * from resource_pool_inv where name like '%OrgvDC-Name%'
Use the new resourcepool value as moid in MOB to validate the existence of the resourcepool. In my case the url will be: https://vcenter-fqdn/mob/moid=resgroup-551443
Use the previous query with the existing resourcepool value to verify the resourcepool in SQL.
select * from vrp_rp where sub_rp_moref = 'resgroup-551443'
Create a valid SQL database backup of the vCloud database before making any changes to the database.
Note: If you are not comfortable with making any changes in the SQL database, please contact the VMware support team so that they can do this for you. You can easily create a support ticket at VMware by visiting the following url.
Updating the org_prov_vdc object with the correct resourcepool
The sub_rp_moref value needs to be updated with the correct resourcepool moref value. Use the next query with the existing resourcepool value and the ID of the impacted org_prov_vdc object to update the value:
update org_prov_vdc set sub_rp_moref ='resgroup-551443' where id=0xDB7C2B7BB4A643ADA28EE527DBB89FC8
After performing the query to update the impacted org_prov_vdc object, I was able to edit the VM configuration in vCloud without any issues.
Find more impacted objects in the org_prov_vdc
Use the following query to find out if there are more impacted objects in the org_prov_vdc.
select * from org_prov_vdc where sub_rp_moref not in (select sub_rp_moref from vrp_rp)
Perform the same steps to fix issue for those objects as well.
Note: It might happen that you will get more than 1 resource pools when querying the resource_pool_inv table. This is the result of using elastic vDC within your Provider vDC. In this case you can just select one of the enabled resource pool to fix the issue.
Double VCP DCV/NV | VCIX-DCV 2019 | vExpert 2020 | vExpert 2020 Cloud Provider
All vForum online sessions are available to watch on demand now: #vExpert https://bit.ly/3dXsqVQ
Hello All, Check out my first Session VMware Tutorial for Beginners vSphere 7, I will be teaching you from basics to advance level.
I will be posting every Thursday 4pm GMT.
#VMware #vSphere7 #vCenter7 #vexpert #vcenter #vcommunity Subscribe,Like & Share