CloudStack: change vCenter username and password

OK, lets run through the database tables and steps involved and changing your CloudStack vCenter username and/or password. I generally like to stop cloud-management service before changing like this.

Tables involved

  • cloud.host
  • cloud.host_details
  • cloud.cluster_details

Log into your CloudStack management node and encrypt the new password ‘dave-says-hi’

Good to note that everytime you run the encryption command the output will be different. Don’t worry thought, it always decrypts back to the original plaintext.

You don’t need to but it’s good to test decrypting to make sure everything works

Good we’ve got our new vCenter password.

2. Change the vCenter password

Now over to the database.
This query will list all your VMware host ID’s, their names and the current vCenter password. The passwords appear different but if you run them through the decrypt command above, you should get the same existing vCenter password everytime.

So now we have the host ID’s, we need to change the “value” field where the name=’password’ and host_id=(19 and 20 in this example)

Now there’s another table in the mix, cluster_details, which has the password in plaintext. Honestly, I don’t know where it’s used but it should be changed to be consistent.

Notice we’re noting using host ID’s here, we’re just using the id of the cluster_details table for the rows with name=’password’.

 

3. Change the vCenter username

Changing the vCenter username is the same procedure modified a little.

Lets see the query to give us the existing username for vCenter

So here’s the update to change the username

And finally we’ll update the cluster_details table too.
Lets have another look at that table

Don’t forget we’re using the id’s for the rows which have the name=’username’

 

 

Posted in CloudStack
One comment on “CloudStack: change vCenter username and password
  1. Prakash says:

    Hi,
    When i follow your article i hit below error in the start it sefl (while generating the password)

    Exception in thread “main” java.lang.NoClassDefFoundError: org/jasypt/intf/cli/JasyptPBEStringEncryptionCLI
    Caused by: java.lang.ClassNotFoundException: org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    Could not find the main class: org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI. Program will exit.

    I am citrix cloudstack. Do you have any suggestion ?

Leave a Reply

Your email address will not be published.