Hi everyone, I'm slowly getting to grips with some of the vCAC features. I've managed to build some basic profiles with some basic customisation. I'm using customisation specs along with custom properties (http://dailyhypervisor.com/vcloud-automation-center-vcac-5-2-custom-hostnaming-extension/).
I now need to edit the /etc/hosts file for RHEL. By default the file is created with the standard loopback address 127.0.1.1 [hostname]
I need this to reflect the IP address of the VM itself and preferably remove the loopback address.
Any help would be greatly appreciated. PLease dont hesitate to ask questions.
Thanks in advance
The best way to go about this would be to write a shell script that will take the hostname and the IP as parameters and will modify the /etc/hosts file to your liking. Automate that action so that you can call .\myscript <hostname> <IP> from a command line before you try and get vCAC to do it. Once that is done there are 2 ways to go about executing that as part of your provisioning workflow:
1. You could use the vCAC guest agent. I would say that this would be the preferred method BUT I do not like it and there a few major reasons why. First of all, it has very limited OS support. Second, it has to be configured to work specifically with your vCAC install meaning if you use this template for other things you would always have this guest agent trying to check in with vCAC. Also, I don't know how much success you would have passing parameters to the script the agent runs. Example: http://www.vmtocloud.com/add-requester-to-administrator-group-of-windows-vm-in-vcac-6/
2. Use vCO. There is an workflow in vCO called run program in guest. You can create a stub that will get the parameters you want (hostname,IP) then kick off your script in the guestOS passing those values. I love this method because 1, it uses VMware tools so many more OSs are supported and 2, I can use scripting objects to build the command that I want to run. you can see a good example of this written by eatVM here Adding a user to a newly provisioned VM