nathan-uk
Contributor
Contributor

vRealize Generate CSV File Error

Using the vRealize 7.0.1 Bulk Imports to Generate CSV file, I get the error "An error occurred while creating export: Object reference not set to an instance of an object."

I have tried various settings and discovered that if I disable the reservations associated to the business group selected in the Generate CSV File form I can get a CSV file to export, looking at the error I suspect I have an issue with the data in the IaaS SQL database.

I have looked through a number of logs on the IaaS server but cant see any errors related to this also the Compute Resource Data Collections are working without any issues.

vra-import-err.PNG

Any ideas ?

0 Kudos
5 Replies
BryanHalter
Contributor
Contributor

Please get in touch with GSS, this looks like an issue that we haven't seen before and will require more investigation

0 Kudos
Michael_Rudloff
Enthusiast
Enthusiast

SR has been opened and logs attached :16267004010

___ My own knowledge base made public: http://open902.com
0 Kudos
rmav01
Enthusiast
Enthusiast

Had a similar issue a few months ago, refer to this thread:

get error on generate CSV for bulk import

You're using 7.0.1 which is what I was using during this time as well. Long story short I had blueprints with the same IDs across multiple tenants and it caused this error. Not sure if you have the same setup, but I had to go through and copy all the blueprints in one tenant, change the ID, then delete the original I copied from. If you're just copying blueprints between tenants, this is very easy to have happen. Not sure if they fixed it in 7.1 or not.

Hopefully this is your problem too, good luck!

0 Kudos
nathan-uk
Contributor
Contributor

Worked with GSS to resolve this here is the solution.

Symptoms:

Using the vRealize 7.0.1 Bulk Imports to Generate CSV file, I you receive the error "An error occurred while creating export: Object reference not set to an instance of an object."

The Infrastructure Logs show a similar error to below:

Disk name:'Hard disk 1' ExternalDiskID:'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx', vm:VIRTUALMACHINE’ does not have or lost its storage. This may have been caused by a storage being moved.

Resolution:

1.    Using Microsoft SQL Management Studio connect to the SQL Server hosting the vRealize IaaS database.

2.    Take a backup of the database.

3.    Run the below query to confirm there are HostToStorage paths with NULL entries, this should return the same Virtual Machines and Disks as seen with errors in the Infrastructure Logs.

SELECT h.HostName, vm.VirtualMachineName, vm.IsManaged, vm.StoragePath, vmd.DiskName, vmd.Capacity, vmd.DeviceID

FROM dbo.VMDiskHardware vmd

JOIN dbo.VirtualMachine vm

ON vmd.VirtualMachineID = vm.VirtualMachineID

JOIN Host h

ON vm.HostID = h.HostID

WHERE vmd.HostToStorageID IS NULL

4. Run the below SQL query to clean the bad records from the VMDiskHardware table in the IaaS database.

DELETE FROM VMDiskHardware

WHERE HostToStorageID IS NULL

5. In the vRealize portal run an Inventory Data Collection on the Compute Resource.

6. Run the Bulk Import Generate CSV file again.

rizeqa
Contributor
Contributor

Dears

Is the case Solved or not? if yes please provide me with the steps.

thank you

0 Kudos