Skip to main content

vCenter Reinstallation after 60-Days trial expires without losing Database Contents

Many of us still evaluating the vSphere and vCenter in our test environments. Sometimes, it takes more than 60 days to evaluate where trial edition expires.


We can't extend the trial edition in ESX host, either we have to reinstall it or license it. vCenter also have to follow the same way as ESX does. But, here we can keep old database contents as it is when you reinstall the vCenter software.


This document using vCenter 4.0 and SQLEXPRESS 2005 (built in) database. At the time of installation of vCenter 4.0, it installs SQLEXPRESS 2005 by default unless any other Database specified. Mostly, we are using built-in database is SQLEXPRESS 2005 for testing environment.


When you install vCenter 4.0, it installs SQLEXPRESS 2005 and creates a database called "SQLEXP_VIM". You can view this thru SQL Server Configuration Manager console.


Start à All Programs à Microsoft SQL Server 2005 à Configuration Tools à SQL Server Configuration Manager


Creating DSN


Create a System DSN for this database using ODBC (Administrative Tools à Data Sources (ODBC) either before/after expiry of your vCenter trial period.


Open the ODBC Database Administrator Source, Select "System DSN" and Click "Add" Button and Select "SQL Native Client"




Provide the Datasource name (recommened to use as "SQLEXP_VIM")


Select, the server and database name (mostly local host, since it is installed on the same server where we installed vCenter earlier)



Leave the Authentication as default. It is important to change the default database to

VIM_VCDB as shown in the picture: (Select in the list)

Press Next and leave them to default settings and Test Connectivity.

Use the Add/Remove Programs to uninstall the vCenter 4.0 after trail period is over.

Reinstalling the vCenter

When you reinstall the vCenter on same server, select the "Use an existing supported database" on database section. Then, enter "sqlexp_vim" as the DSN and press "Next" and leave blank for UN/PW




Select "Do not overwrite, leave my existing database in place" and press "Next", leave it default




 

After complete database selection, continue with your installation as usual.

Once the vCenter installation completed, open it thru vSphere Client, you can see your old settings such as Datacenter, Cluster and other configuration. Again, your evalution periods starts with 60-days again.

Comments

Anonymous said…
Great article! Can we reinstall the trial vCenter again on the same machine without cleaning registry or anything?
Anthony said…
works like a charm, thanks you!
Dan said…
Assuming you created an ODBC connection named "VIM_SQLEXP" you can just use this batch file I wrote. It stops vCenter, re-installs it using the existing DB and then restarts the server, giving reason "planned application install".


net stop "VMware VirtualCenter Server" /y

start /wait VMware-vcserver.exe /s /w /L1033 /v" /qr WARNING_LEVEL=0 USERNAME=\"Username\" COMPANYNAME=\"Company\" DB_SERVER_TYPE=Custom DB_DSN=\"VIM_SQLEXP\" VPX_USES_SYSTEM_ACCOUNT=1

shutdown /r /d P:4:2
Anonymous said…
just tried Dan's recipe - did not work for me. going to re install vCenter.
fred said…
This is working also with vcenter 5 appliance.

Stop vCenter service
#service vmware-vpxd stop
Backup the vCenter appliance database
#mkdir /tmp/bkp
#chown db2inst1: /tmp/bkp
#db2 force applications all
#db2 backup db vcdb to /tmp/bkp
Copy the file locally (scp...)
Delete from disk the current vcenter
Re-deploy the appliance. Change IP@, …
Stop vCenter service (if started)
Create the tmp dir /tmp/bkp
mkdir /tmp/bkp ; chown db2inst1: /tmp/bkp
Copy the file to the new vcenter (scp … /tmp/bkp)
Restore the vCenter appliance database
db2 restore db vcdb from /tmp/bkp replace existing
Start vCenter service (service vmware-vpxd start)
Jus said…
Dans does work anon.

Just requires a couple of changes depending on your setup

Where he has "VMware-vcserver.exe" it should be the path or share where the install application is installed from (mine is D:\vCenter-Server\VMware-vcserver.exe) i.e the cd

And the DSN entry is the one you specified in odbc(mine is vSphere), just check under Data sources (ODBC) mines in system.

I've created a Schedule to run every 55 days :)

Cheers to all
Jus said…
Sorry forgot to say the batch file needs to be run as administrator/elevated

my batch file resetvspherelic.cmd

net stop "VMware VirtualCenter Server" /y


start /wait D:\vCenter-Server\VMware-vcserver.exe /s /w /L1033 /v" /qr WARNING_LEVEL=0 USERNAME=\"Username\" COMPANYNAME=\"TOMTIT\" DB_SERVER_TYPE=Custom DB_DSN=\"vCenter\" VPX_USES_SYSTEM_ACCOUNT=1


shutdown /r /d P:4:2

Anonymous said…
wow Fred and Jus' comments are just gold. I happened to be using the vCenter appliance and hence I have to go the Linux way. I haven’t had a chance to verify Jus’ comment though.

For the Linux way here is the text file I wrote and I use these every time I have to refresh the license. Tedious, but still so much better than redeploying the entire vCenter + the ESX hosts + the VMs.

Backup DB:
service vmware-vpxd stop
mkdir /tmp/ChrisBackup
chown db2inst1: /tmp/ChrisBackup
su - db2inst1
db2 force applications all

db2 backup db vcdb to /tmp/ChrisBackup
Copy the file locally (winscp from /tmp/ChrisBackup)

Remove the vCenter VM and rename the folder to something like vCenter.expired (just in case)
Re-deploy the appliance (see Setup Details)

Setup Details:
This appliance contains System Disk, Data Disk and the OVF File.
You do not have to copy the files. Simply double click on the OVF file and VMware Workstation will import the VM.

Once import is completed, reduce the vRAM from 8GB to 4GB and start the VM.
Once started configure the IP address and time settings

Connect to https://(some IP address):5480/

* * * * Accept the EULA * * * *

root
vmware

1) Accept the EULA the first time you log on to the web interface
2) Configure DB
3) Restore DB (see Restore DB)
4) Start vCenter

For redeployment, right click to reconnect to each of the ESX server in the vCenter inventory.

Restore DB:
service vmware-vpxd stop
mkdir /tmp/ChrisBackup
chown db2inst1: /tmp/ChrisBackup
Copy the file to the new vcenter (winscp to /tmp/ChrisBackup)
chown db2inst1: /tmp/ChrisBackup/VCDB(Keyboard Tab Key)

su - db2inst1
db2 restore db vcdb from /tmp/ChrisBackup replace existing
exit
service vmware-vpxd start

Chris

The power of Cloud.....
Anonymous said…
Great article, worked like a charm. Many thanks :)
Loloke said…
Anyone with 5.1? It's not working for me. :(
Anonymous said…
Procedures does not works with 5.1.
Anonymous said…
These procedures doesn't works with vCenter 5.1...
Tried everything with no success - only complete reinstall with database overwriting can reset evaluation period
Jus said…
Hi anon, sorry haven't posted, must admit not really looked at 5.1 yet studying for ccna.
No doubt there will be a way but thanks for posting your experiences with it.
Anonymous said…
Hi, Jus and all!

I have good (or bad) news about resetting vCenter server 5.1 eval period. In this version 5.1, it saves information about evaluation date somewhere in the SQL database VIM_VCDB.
I've completely uninstalled SSO, Inventory, and vCenter from Add/Remove programs, and then manually deleted all VMware files, logs and so on and only VIM_VCDB database stayed untouchable...
After that I've done fresh install of the VMware vCenter Simple Install and during this installation I've selected "Do not overwrite, leave my existing database in place". After the installation evaluation period of the vCenter server didn't reset. If I only do reinstalling vCenter server with the overwriting VIM_VCDB database, then evaluation date successfully resets.

Regards,
Victor
Steve said…
Hello everybody. Glad to find this blog. Regarding the vCenter Server Appliance (vCSA) 5.1 I would be very interested to extend its trial period if possible. It seems the expiration date is transferred with the database so what i tried to do is: take a backup of my old vCSA and shut it down, create a new vCSA on another host with the same IP and hostname (to preserve connection with ESXi servers and Nexus) and transfer the database as per KB 2034505 in VM forums. In that way I preserver the database but I was disappointed to see that the expiration date is carried along. I have no experience in databases but I found several keys/terms related to the expiration. I just wish there is a way to overwrite/alter the remaining expiration time. Does anyone have a clue or a way forward ? Regards !
Steve said…
Wondering whether the remaining expiration time is absolute or relative to the database i.e. whether by overwriting with this database in the following 2 days license still expires on the same day as before or will I gain 2 days. If it is absolute will changing the time settings gain anything ?
Ness Tech said…
Hello
did anyone tested it with PostgreSQL embalmed DB ,I have vCenter Applicance 5.0.1 and I need to renew to trial version.

Regards
Sofiane
Anonymous said…
Hi admin,

Thanks a lot, you make my day. i did with VMware vcenter 5.0 version it working like charms.


Popular posts from this blog

Set VLAN ID to IPMI Address in Nutanix

The IPMI is remote management interface like as HP iLO, DELL DRAC. During the Nutanix cluster deployment, it is not possible to mention the VLAN ID of the IPMI's IP Address. This need to be entered thru command line via ESXi host or Windows Hyper-V. This article talks about ESXi host only. Login to ESXi thru SSH client. Run the following command to enter the VLAN ID (we assume that you already configured IP Address) ~ # /ipmitool lan set 1 vlan id 333 ~ # /ipmitool lan print1 Set in Progress         : Set Complete Auth Type Support       : NONE MD2 MD5 PASSWORD  Auth Type Enable        : Callback : MD2 MD5 PASSWORD                          : User     : MD2 MD5 PASSWORD                          : Operator : MD2 MD5 PASSWORD                          : Admin    : MD2 MD5 PASSWORD                          : OEM      : MD2 MD5 PASSWORD  IP Address Source       : Static Address IP Address              : xx.xx.xx.xx Subnet Mask             : 255.255.254.0 MAC

Changing Thin to Thick disk and vice-versa

You can change the existing Virtual Hard disks (VMware based) from Thick to thin and vice-versa. This can be achieved by either using VMotion/SVMotion or command line tool called " vmkfstools". Using VMotion/SVMotion is required a valid license. Select “Migrate” and choose “Change Datastore” and select the Disk format. If you don’t have a VMotion/SVMotion license, use the following command to achieve the same. From Thick to Thin: vmkfstools –i "Thickdisk.vmdk" -d thin "Thindisk.vmdk" It will start to clone to virtual hard disk in Thin Provision method. After completed, you can attach this disk with VM and power it on. If all looks good, you can delete the original thick disk from the data store. Use the following command to see real-time usage of thin disk: du –h "Thindisk.vmdk" You can notice the big difference of disk usage between of Thin and Thick format disks. From Thin to Thick: vmkfstools –i "Thindisk.vmdk" -d zeroedthick "T