VMware Cloud Community
Virtuatron
Contributor
Contributor

Cannot get CentOS7 customisation to work while creating from template

Hi,

VMWare newbie, so go easy on me!

I have created a CentOS 7.2 VM, fully patched, installed perl, net-tools, and open-vm-tools 9.10.

I have converted it to a template.

I have created a Linux Customisation Specification and configured it to ask for an IP and mask, and specified "use virtual machine name" for computer name and set domain name to my required domain.

I Created a VM from the template, and selected "customise the operating system", and type in my IP and mask.

All goes well except the resulting VM has a hostname of my VM name, but it has not appended the domain name to create a full dnsname as required.

I have tried other methods in the Customisation Specification, including "Enter a name", and "Enter a name in the Clone/Deploy wizard" but nothing I have tried gives me a full dnsname with the domain appended.

When using the latter (enter name in wizard) I tried a short hostname as well as a FQDN, and the latter was rejected, saying it was not a valid NETBIOS name!

Hope someone can help me.  I'm so close to getting VM deployment from template working but for me, changing the hostname seems like such a fundamental thing that it really should just work.

I'm doing all this from vSphere Web Client by the way, on VCS 6 and ESXi 6.

Regards,

G

0 Kudos
5 Replies
Virtuatron
Contributor
Contributor

54 views and no replies. Smiley Sad

Can I assume by this that nobody is using VMWare in this way?  Is nobody else running CentOS7 VMs? 

Is nobody else deploying VMs from templates straight form vSphere Web Client?  Is everyone using other scripted methods, APIs or third party integrations?

Regards,

G

0 Kudos
EyeScuzzy
Contributor
Contributor

Hi, Virtuatron

Before convert VM to template (at preparation stage), run open-vm-tools service:
systemctl start vmtoolsd.service

This action adds parameter string in VM vmdk file:

ddb.toolsVersion = "version here"


VMware vCenter (either VCSA and vCenter) can not get open-vm-tools version while cloning template VM

... Unexpected value for tools version: 0.
and as result guest customization will fail.


That is.


Regards,

0 Kudos
MKguy
Virtuoso
Virtuoso

What vCenter version are you using? CentOS 7 customization is only supported from vCenter 5.5 U3 and 6.0 onwards, see:

http://partnerweb.vmware.com/programs/guestOS/guest-os-customization-matrix.pdf

Also try setting the VM object GuestOS setting to RHEL7 instead of CentOS. This was required in the past to work around the support limitation and you might have to edit /etc/redhat-release as well: http://serverfault.com/questions/653052/from-vsphere-5-5-deploying-centos-7-from-template-ignores-cu...

You can find customization logs in /var/log/vmware-imc/toolsDeployPkg.log.

With tools version 9.10 you should be fine, as this should include the deploypkg rpm as well:

Installing the deployPkg plug-in in a Linux virtual machine with open- vm-tools version lower than 9...

Can you check that with rpm -qa | grep deploy?

For earlier tools versions installing just the open-vm-tools package is not sufficient they are missing the utilities needed for template deployment. You also need to have the separate deploypkg installed:

http://partnerweb.vmware.com/GOSIG/CentOS_7.html

  1. Add the deployPkg Tools Plug-in
    If you are using the virtual machine as a template or if it will be protected by SRM (Site Recovery Manager), then install the deployPkg Tools plug-in. To install this plug-in:
    1. Create a file, /etc/yum.repos.d/vmware-tools.repo, with the following content:
      [vmware-tools]
      name = VMware Tools
      baseurl = http://packages.vmware.com/packages/rhel7/x86_64/
      enabled = 1
      gpgcheck = 1

    2. Install the package:
      $ sudo yum install open-vm-tools-deploypkg
      See knowledge base article 2075048, Installing the deployPkg plug-in in a Linux virtual machine, at http://kb.vmware.com/kb/2075048.
-- http://alpacapowered.wordpress.com
0 Kudos
Virtuatron
Contributor
Contributor

Thanks for the reply EyeScuzzy.

I'm sorry but as 4 weeks had passed from my post I had moved on to other work.  I do not think my use case was suitable for templates because my requirements were going to be so different for each VM.

I will revisit this when I get time.

But, from memory, I was running open-vm-tools in the VM before conversion and I was not getting the "unexpected value" error.

Many thanks.

0 Kudos
Virtuatron
Contributor
Contributor

Thanks for the reply MKguy

I'm sorry but as 4 weeks had passed from my post I had moved on to other work.  I do not think my use case was suitable for templates because my requirements were going to be so different for each VM.

I will revisit this when I get time.

But for the sake of completeness: I am running vCenter Server 6.0 (sorry I didn't state that, but I posted in the ESXi 6.0 thread so I thought it was assumed).

I did try the redhat workaround but that didn't seem to help me, and you are correct that deploypkg is not needed with 9.10.

Many thanks.

0 Kudos