Usage Meter 3.2 Import data fails

Look at the old post for How to upgrade UM to 3.2 . In this post I will cover the error faced while upgrade.

When I was  importing the data from old appliance, I got below error

Connection closed by remote host

To dig this error in detail, I trid to ssh to old appliance

ssh root@old-appliance-ip

 

I got error "Connection closed by remote host", this didn’t give me much information why was the error occurred, so thought of getting more information to resolve the issue. I tried ssh with verbose logging so that I can see what exactly happening in the background, tried with below command and it did give me detailed information about the issue.

ssh -vv root@old-appliance-ip
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [xx.xx.xx.xx] port 22.
debug1: Connection established.
debug3: Not a RSA1 key file /c/Users/MoreFreeze/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace 
// above it repeats 24 times
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /c/Users/MoreFreeze/.ssh/id_rsa type 1
debug1: identity file /c/Users/MoreFreeze/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host

 

This proves that there is some error and it was confusing me with the certificate, after 15-20 minutes of googling found that there is something wrong in the hosts.deny file in the /etc/ directory, actually it is not wrong but for security. I edited the hosts.deny file and commented out the line “ALL:ALL”, it started working but I knew that it is not the right way to deal with this, further researching about this gave me idea to add SSHD:ALL in the hosts.allow file in /etc/ directory.

 

  • edit the file /etc/hosts.allow using VI editor, to know how to use VI editor check this VMware KB 1020302
  • vi /etc/hosts.allow
  • Add the line SSHD:ALL
  • Restart the SSH Daemon process
  • service sshd restart
  • To verify tried ssh again, got the password prompt, huh it started working
  • Then tried importum command and the UM upgraded to 3.2 successfully.

 

Please feel free to comment below if you [readers] have faced some other issue.

 

This post first appeared on the Virtualization Express blog at virtualizationexpress.com, by Karthic Kumar .
Copyright © 2013 – VirtualizationExpress . All rights reserved. Not to be reproduced for commercial purposes without written permission.

Upgrading vCloud Usage Meter 3.2 / 3.3 / 3.5

In this post, I will walk you through how to upgrade to UM3.2 / 3.3.

    1. Upgrading Usage meter 3.2 / 3.3 from Usage Meter 2.3.2 to 3.1.0
    2. Upgrading Usage meter 3.3 from Usage Meter 3.2

 

Upgrading Usage meter 3.2 / 3.3 from Usage Meter 2.3.2 to 3.1.0
UM3.2 supports import data from following versions only, 
 vCloud Usage Meter 2.3.2
 vCloud Usage Meter 3.0.0
 vCloud Usage Meter 3.0.2
 vCloud Usage Meter 3.1.0

.[info title=”Note”]if you are having older version then you must upgrade to supported version and then upgrade to 3.2[/info]

Steps for Import:

Flow:

 
 
UM3.2Upgrade

Detailed Steps:

    1.  Download the new Usage Meter Appliance from here  (3.2) & 3.3:
    2.  Deploy and power on new appliance
    3.  Assign IP address
    4.  Go to Old Appliance and enable SSH
      service <span class="mceItemHidden" data-mce-bogus="1"><span class="hiddenSpellError" pre="service " data-mce-bogus="1">sshd</span></span> start
    5.  Go to new appliance and run command
       <span class="mceItemHidden" data-mce-bogus="1"><span class="hiddenSpellError" pre="" data-mce-bogus="1">importum</span></span> <IPADDRESS> <OldVersion>
       vCloud Usage Meter 2.3.2 -->  232
       vCloud Usage Meter 3.0.0 --> 300
       vCloud Usage Meter 3.0.2 --> 302
       vCloud Usage Meter 3.1.0 --> 310
       <span class="mceItemHidden" data-mce-bogus="1"><span class="hiddenSpellError" pre="" data-mce-bogus="1">importum</span></span> xx.xx.xx.xx 232 
    6.  After successful completion, go to the UM 3.2 console and verify if you have all the data
    7. Power off and delete the old Appliance

 

Upgrading vCloud Usage meter from 3.2 to 3.3:
  1. Download vCloud Usage Meter 3.3 Updater from here
  2. Transfer the patch file, usage-meter-330-update.zip to /root in the appliance
  3. Unzip usage-meter-330-update.zip
  4. Enter cd usage-meter-330-update
  5. Enter ./update-um
  6. Appliance is upgraded to 3.3 GA.
    What to do next

    Monitor results to ensure continuous data collection.

Upgrading vCloud Usage meter from 3.2 / 3.3 to 3.5:
  1.  Download the new Usage Meter Appliance 3.5  from here
  2.  Deploy and power on new appliance
  3.  Assign IP address
  4.  Go to Old Appliance and enable SSH
    service <span class="mceItemHidden" data-mce-bogus="1"><span class="hiddenSpellError" pre="service " data-mce-bogus="1">sshd</span></span> start
  5.  Go to new appliance and run command
     <span class="mceItemHidden" data-mce-bogus="1"><span class="hiddenSpellError" pre="" data-mce-bogus="1">importum</span></span> <IPADDRESS> <OldVersion>
     vCloud Usage Meter 3.3.3 --> 333
     vCloud Usage Meter 3.4.0 --> 340
  6.  After successful completion, go to the UM 3.2 console and verify if you have all the data
  7. Power off and delete the old Appliance / Keep backup

 

[Revision]
27-Dec-2013 – Initial post
5-June-2014 – Updated instructions for UM 3.3

21 Dec-2016 – Updated instructions for UM 3.5

 

 

This post first appeared on the Virtualization Express blog at virtualizationexpress.com, by Karthic Kumar .
Copyright © 2014 – VirtualizationExpress . All rights reserved. Not to be reproduced for commercial purposes without written permission.

How to backup and restore of vCloud Usage Meter DB

Backup / Restore of vCloud Usage Meter DB

In this post, I explained how to backup/restore the vCloud Usage meter DB that I found through surfing, collectively it took me more than 60+ minutes to find the steps.

Any one can use this post regardless of the Usage Meter version.

 

To Backup: 


– Login to Usage Meter appliance as root  and run following commands

#su - postgres 



#cd /opt/vmware/vpostgres/xx/bin/


(xx = Version of the postgres, it varies version to version)

#./pg_dump usage_meter_db >> /tmp/dbbackup


To Restore: 

Take a snapshot of the VM before restoring

Login to Usage Meter appliance as root  and run following commands

su - postgres 



cd /opt/vmware/vpostgres/xx/bin/


(xx = Version of the postgres, it varies version to version)

./dropdb usage_meter_db


(Delete the existing DB

./createdb usage_meter_db


(Create a empty DB)

psql usage_meter_db < /tmp/dbbackup


(Restore DB)

or

sudo -u postgres </span>/opt/vmware/vpostgres/xx/bin/psql usage_meter_db &lt; /tmp/dbbackup<span> usage_meter_db


(xx = Version of the postgres, it varies version to version)

 

This post first appeared on the Virtualization Express blog at virtualizationexpress.com, by Karthic Kumar +.
Copyright © 2013 – VirtualizationExpress +. All rights reserved. Not to be reproduced for commercial purposes without written permission.