[
https://issues.apache.org/jira/browse/CLOUDSTACK-4556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14167831#comment-14167831
]
Brent commented on CLOUDSTACK-4556:
-----------------------------------
Note: I have found a workaround for this issue:
Create your cloudstack instance with name "localhost". Also, make the VM
"localhost" during the installation. Skip step #4 in the cloudstack ubuntu
documentation for templates: rm -f /var/lib/dhcp/dhclient.*
This will trick the script into running the script when a new VM is created
from the template.
Let me know what you think!
> "12.10. Creating a Linux Template" sethostname script problems
> ---------------------------------------------------------------
>
> Key: CLOUDSTACK-4556
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-4556
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: Doc
> Affects Versions: 4.1.1
> Reporter: Martijn Koster
>
> In the nightly build doc
> http://jenkins.cloudstack.org/view/master/job/build-docs-admin-master/lastSuccessfulBuild/artifact/Apache_CloudStack-4.2.0-Admin_Guide-en-US.pdf
> section "12.10. Creating a Linux Template", there is a sethostname script,
> which has several issues:
> The script appears to assume that it is called once, and that at that time
> the dhcp leases file has info in it.
> What I've seen happen is that the first time it is invoked, the leases file
> is empty, and the script then destroys
> /etc/hosts and /etc/hostname because it does no checking, and the second time
> when the leases file has the required info, the hostname is no longer
> "localhost", so the script is skipped. And this approach is strange anyway:
> the script goes through effort to extract values from the leases file, but it
> doesn't need to -- they are passed in by dhclient.
> It calls "dpkg-reconfig" on
> https://github.com/apache/cloudstack/blob/922ef76224d4a8534f67f47b97cf664e5c65ecba/docs/en-US/prepare-linux-template.xml#L104
> which should be "dpkg-reconfigure" on my ubuntu 12.04 instance:
> root@test3:~# which dpkg-reconfig
> root@test3:~# which dpkg-reconfigure
> /usr/sbin/dpkg-reconfigure
> root@test3:~# uname -a
> Linux test3 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:13:26 UTC
> 2013 x86_64 x86_64 x86_64 GNU/Linux
> It would also be nice to set DEBIAN_FRONTEND=noninteractive such that
> dpkg-reconfigure doesn't cause debconf frontend warnings in the log.
> In
> https://github.com/apache/cloudstack/blob/922ef76224d4a8534f67f47b97cf664e5c65ecba/docs/en-US/prepare-linux-template.xml#L108
> it sets user/group execute permissions for the script, but that is not
> required. dhclient-script(8) documents "invoked using the ´.´ command", and
> the other scripts in the /etc/dhcp/dhclient-exit-hooks.d/ directory have mode
> 644.
> I'm working on an alternative in https://gist.github.com/makuk66/6379642
> which appears to work but could do with some more testing.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)