DRS and HA appear disabled and DRS rules and groups were lost after enabling storage profiles + unsupported solution

After enabling storage profiles we noticed that our DRS and HA were disabled and even the rules and groups where gone !!!

A quick google brought us to the blogarticle of  Duncan Epping : “HA & DRS appear disabled when a VM Storage Profile is enabled / disabled

Thanks to Google and Duncan we had an explanation in no time but now what ?  It looks like in our case , it was not only a cosmetic problem, but also meant loss of information !

So what did I do to get this info back? I dived into the SQL Table of vcenter with SQL Management studio and found where this DRS AND HA info was stored [VPX_COMPUTE_RESOURCE]
I decided to experiment a little to get this info back…

WARNING : THIS IS NOT A SUPPORTED SOLUTION !  (but it works ;-))

  1. restored a backup of the current [VCDB5] virtual center database to another instance -> I called the database [VCDB5OLD]
  2. stopped all virtual center related  services (wrote down (or pin down) your vcenter’s host so you know where to connect to in case something happens)
  3. First I made a backup of the current  information in the table that holds this resource info to another table so I could go back at any time when #!@  happens
    Select * into VPX_COMPUTE_RESOURCE_BACKUP_ERIK FROM [VCDB5].[dbo].[VPX_COMPUTE_RESOURCE]
  4. I queried the restored backup table  in SQL management studio and resulted in 9 records for our 9 clusters
    select * from [VCDB5OLD].[dbo].[VPX_COMPUTE_RESOURCE]
  5. I opened up the current table in edit mode in SQL management studio (right click on the table and choose edit top 200 rows)
    select * from [VCDB5].[dbo].[VPX_COMPUTE_RESOURCE]
  6. Now, the nex part is a copy paste procedure because I was under time pressure ,  I’m also no SQL guru and I only had 10 records so I did this manually
  7.  go to the first row of the [VCDB5OLD].[dbo].[VPX_COMPUTE_RESOURCE]  and go to the field RULES_INFO – right click and choose copy
  8. go to the first row in the EDIT QUERY of step 5 of the current [VCDB5].[dbo].[VPX_COMPUTE_RESOURCE] and replace the RULES_INFO content
  9. go to the first row of the [VCDB5OLD].[dbo].[VPX_COMPUTE_RESOURCE]  and go to the field GROUPS_INFO – right click and choose copy
  10. go to the first row in the EDIT QUERY of step 5 of the current [VCDB5].[dbo].[VPX_COMPUTE_RESOURCE] and replace the GROUPS_INFO
  11. repeat step 7 to 10 for all the records in your DB.
    Again, because I ‘m no SQL guru and I only had 10 records so I did this manuallyNote: after my intervention succeeded , I checked the right syntax for people who don’t want to do it manually:
    update    VCDB5..VPX_COMPUTE_RESOURCE
    set       VCDB5..VPX_COMPUTE_RESOURCE.RULES_INFO      =         VCDB5OLD..VPX_COMPUTE_RESOURCE.RULES_INFO
    from      VCDB5..VPX_COMPUTE_RESOURCE
    INNER JOIN  VCDB5OLD..VPX_COMPUTE_RESOURCE
    ON    VCDB5..VPX_COMPUTE_RESOURCE.ID               =       VCDB5OLD..VPX_COMPUTE_RESOURCE.ID

 

 

Be the first to comment

Leave a Reply

Your email address will not be published.


*