Password Based Authentication vCenter CentOS 7 Template

We have successfully installed Opennebula with vCenter 6.7 with Nginx proxy and everything is working such as Public Networking as well as private networking.

We have created a template in vCenter and imported into Opennebula and SSH authentication is working as expected. However we would also like to have the option of also using password based authentication but cannot seem to get this working.

We have tried adding PASSWORD as a user input on the contextualization but this does not seem to work.

Is is possible to have password with with vCenter templates and if so what is the correct user input ? The OS we are testing on is CentOS 7.

Hello @Ben_McGuire

In order to be able to set root password, you need to set the variable PASSWORD in context section. Check this link for more information.

You need to be sure that Contextualization packages are installed on the VM, check this link to know how to get them.

Best,
Álex.

Hi,

Thank you for the information. I had already reviewed the documentation that you provided.
A few questions:-

As we are using vCenter ( not vonecloud ) I noticed the there are two options in the context section. One for vcenter contextualization and the other for Openebula. Which once is correct ?

I tested with both and using the vcenter option the VM does not boot. Using Opennebula the VM boots but no password is injected.

I shall past the template sections for your review. I can confirm that the CentOS7 contexulization packages are installed and working as SSH key auth works just fine.

USER TEMPLATE

DESCRIPTION = “vCenter Template imported by OpenNebula from Cluster EU Cluster”
HYPERVISOR = “vcenter”
INPUTS_ORDER = “PASSWORD”
MEMORY_UNIT_COST = “MB”
PASSWORD = “testpassword#123”
USER_INPUTS = [
PASSWORD = “” ]
VCENTER_CCR_REF = “domain-c303”
VCENTER_INSTANCE_ID = “ac06e1a1-1428-4049-8871-452619e8e56c”
VCENTER_TEMPLATE_NAME = “CentOS7”
VCENTER_TEMPLATE_REF = “vm-545”
VCENTER_VM_FOLDER = “”

TEMPLATE

ETH0_VROUTER_IP6 = “”,
ETH0_VROUTER_MANAGEMENT = “”,
NETWORK = “YES”,
PASSWORD = “$PASSWORD”,
SSH_PUBLIC_KEY = “”,
TARGET = “hda” ]

I noticed the template tab there is a generated password which is not the one entered in the user input above. I also tried the password below and that does not work also.

CONTEXT = [
NETWORK = “YES”,
PASSWORD = “ZErj4qLKQqXmAHJUQD54Yg==”,
SSH_PUBLIC_KEY = “$USER[SSH_PUBLIC_KEY]” ]
CPU = “1”
DESCRIPTION = “vCenter Template imported by OpenNebula from Cluster EU Cluster”
DISK = [
IMAGE_ID = “17”,
OPENNEBULA_MANAGED = “NO” ]
GRAPHICS = [
LISTEN = “0.0.0.0”,
TYPE = “VNC” ]
HYPERVISOR = “vcenter”
INPUTS_ORDER = “PASSWORD”
MEMORY = “2048”
MEMORY_UNIT_COST = “MB”
OS = [
BOOT = “” ]
USER_INPUTS = [
PASSWORD = “M|password|root” ]
VCENTER_CCR_REF = “domain-c303”
VCENTER_INSTANCE_ID = “ac06e1a1-1428-4049-8871-452619e8e56c”
VCENTER_TEMPLATE_NAME = “CentOS7”
VCENTER_TEMPLATE_REF = “vm-545”
VCENTER_VM_FOLDER = “”
VCPU = “1”

Any assistance would be most helpful.

Hello @Ben_McGuire,

One for vcenter contextualization and the other for Openebula. Which once is correct ?

The vCenter one is to use vCenter customization, if you don’t use them you should avoid this option. The OpenNebula contextualization is the one that you need for this purporse.

I noticed the template tab there is a generated password which is not the one entered in the user input above. I also tried the password below and that does not work also.

In the VM template you can find the password encrypted using the one_key. So, it will be always different from the one you entered. Another thing is that if you want to use the password you entered with the user inputs, you should add this to context section:

PASSWORD="$PASSWORD"

Finally, take in account that this password will only work if you have the contextualization packages installed and will only work in VNC connection. If you are trying to connect using SSH, you need to configure your SSH public key.

Best,
Álex.