Updating vROps Instance in vCloud Usage Meter

On new deployments of VMware vCloud Usage Meter, sometimes the wrong vRealize Operations Instance (vROps) is propagated to Usage Meter on initial connection. Today, you cannot change or modify this vROps instance. This is frustrating for new users of Usage Meter.

Why?

Well, Usage Meter relies on the Managed Object Browser (MOB) to correlate to the connected vROps instance. In some cases, a VM Administrator may have a stale or older vROps instance still registered to the vCenter environment. For correct reporting and to remove any errors from Usage Meter, this needs to be resolved. 

How do I resolve this?

Three steps to solving this:

  1. Remove the incorrect vROps instance from the vCenter MOB.
  2. Remove the incorrect vROps instance from the Usage Meter database.
  3. Register the correct vROps instance to vCenter.

Before, any of this is done, I suggest snapshotting your vCenter and Usage Meter appliance. Don’t forget to remove the snaps post-completion!

Step 1 – Remove the incorrect vROps instance from the vCenter MOB.

  1. Open your browser to “https://<vCenter-FQDN>/mob/?moid=ExtensionManager” – this is the direct link to the Extension Manager section. Type in administrative credentials to log in. 
  2. Verify you see the extensionList[“com.vmware.vcops”] extension in the list. Click on it. We are going to verify that we see the incorrect vROps instance before we remove it. 
  3. From here, click on “server.” We are going to verify that the incorrect vROps instance is showing up in the extension.
  4. Verify you see the incorrect vROps instance. 
  5. OK, press the back button twice and back to the original URL. Now we will unregister the incorrect vROps instance.
  6. Click on the UnregisterExtension Method at the bottom – 
  7. Now you’ll get a popup requesting the extension name that we will unregister. Type in “com.vmware.vcops” in the box and press the Invoke Method button. 
  8. This may take a few seconds to run. However, you will see a void message. Close the popup and refresh the main browser tab that has the MOB information. We should see that the vcops extension has been successfully removed. 
  9. Step 1 is complete.

Step 2 – Remove the incorrect vROps instance from the Usage Meter database.

Before you start this, please take a snapshot of the Usage Meter appliance. Don’t forget to remove it after you verified the change was successful! 

  1. Open up the Console (or SSH) to the Usage Meter appliance. Log into the console.
    1. Note – If you attempt to SSH, ensure you utilize the “usgmtr” account as remote root logins are NOT permitted by default.
  2. Run the “sql” command to enter the database. 
  3. Query vCOPS table to verify the record we need to delete – type in select * from “VcopsServer”; We can see I only have one instance here, so it’s ID 1. 
  4. Now we will delete ID 1. Delete entry using ID, replace [ID] with the ID gathered from above statement – so type the following two commands:
    1. update “VcopsServer” set “active” = ‘f’ where id = [ID]; 
    2. In my case, I am using:
      • update “VcopsServer” set “active” = ‘f’ where id = 1;
  5. Now let’s check and make sure the vROps instance is removed from UM. Press the up arrow three times and run the select command again. As we can see, there’s 0 rows for “VcopsServer”
  6. Now type “\q” to quit out of the database.
  7. Going back to the Usage Meter console, we can now see the vROps instance is now removed from Usage Meter. 
  8. Now let’s move to re-adding the right vROps instance to Usage Meter!

Step 3 – Register the correct vROps instance to vCenter.

  1. We are now ready to register the right vROps instance to vCenter.
  2. Log into the vROps web console and navigate to Administration -> Solutions -> select the VMware vSphere name. You might see it collecting, but we need to register the plugin into vCenter. 
  3. Click on the wheel icon right under Solutions to open up the Configuration section. We will now click on Manage Registrations to re-register it to vCenter.
  4. Check the box to “Use collection credentials” and click the Register button. 
  5. This might take a moment to register the plugin inside of vCenter, but a successful message will look like the following – 
  6. Going back to my vCenter MOB tab, I can now see vcops under the ExtensionManager section. 
  7. Almost complete! Hop over to the Usage Meter console and click “Synchronize All vCenter Inventories” button right under the vCenter Server section. Then, click the Rebuild button under vRealize Operations Manager. 
  8. There we go! We now see our vROps instance. Click on Edit to put in the correct credentials. Remember, you need to utilize a LOCAL vROps read-only or administrator account. AD/LDAP accounts do NOT work!
  9. Once you put in the credentials, you will see a message stating the credentials are correct. Complete! On the next hourly run, we should see it fully activated and the “Not yet discovered” message will be removed. 

Complete! Now, you’ll be able to monitor your vROps instance and bill based on the usage.

-Daniel

3 thoughts on “Updating vROps Instance in vCloud Usage Meter”

  1. Excellent post Daniel!

    I have followed your instruction to the letter. As you can see below i have two old vrops instances (pasting ssh output hoping formatting and line breakes are intact when posting). One vrops/vcops server id=6 is FQDN and the other vcops/vrops server id=5 is IP (to the same server). But i am unable to delete the rows due to some key constraint from table “UnmanagedVcVrops”. Unfortunally i am not versed in deleting database tables so i dont know what to do next. I tried to list everything in table “UnManagedVcVrops” but it was too long/big.

    Here is the output i get when trying to delete the two ID for vcops and vrops. I had two MOB extensions in vCenter (if that does matter?) I have unregistered both of them.

    usgmtr=> select * from “VcopsServer”;
    id | host | version | userName | password | changed | active | licenseNameId
    —-+—————+—————+———-+——————————————————————+————————-+——–+—————
    6 | vropssrv | 6.6.0.000000 | admin | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | 2017-10-04 20:55:13.445 | f | 2
    5 | x.x.x.x | 6.6.0.6163035 | usgmtr | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | 2017-06-26 12:40:20.567 | t | 2
    (2 rows)

    usgmtr=> delete from “VcVcops” where “vcopsServerId” = 5;
    DELETE 0
    usgmtr=> delete from “VcVcops” where “vcopsServerId” = 6;
    DELETE 0
    usgmtr=> delete from “VcopsServer” where id = 5;
    ERROR: update or delete on table “VcopsServer” violates foreign key constraint “UnManagedVcVropsFK1” on table “UnManagedVcVrops”
    DETAIL: Key (id)=(5) is still referenced from table “UnManagedVcVrops”.
    usgmtr=> delete from “VcopsServer” where id = 6;
    ERROR: update or delete on table “VcopsServer” violates foreign key constraint “UnManagedVcVropsFK1” on table “UnManagedVcVrops”
    DETAIL: Key (id)=(6) is still referenced from table “UnManagedVcVrops”.
    usgmtr=>

    Any help would be greatly appreciated.

    Thank you and keep up the good work.

    1. Hi Magnus, I’m not sure I’m following. I see where it successfully deleted the two entries in your first two commands. Did you save the DB and reboot? After the reboot, did you still see these entries?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.