[
https://issues.apache.org/jira/browse/CLOUDSTACK-3539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13709337#comment-13709337
]
ASF subversion and git services commented on CLOUDSTACK-3539:
-------------------------------------------------------------
Commit ab42c1d6da2e023c30be39285c327e88d9f97cb8 in branch refs/heads/master
from [~yasker]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=ab42c1d ]
CLOUDSTACK-3539: Fix wrong management ip when server start up
The value "localhost" for mgmt server should be over-written anyway.
> Management server ip in global configuration is not updated after first boot
> up in the developer environment
> ------------------------------------------------------------------------------------------------------------
>
> Key: CLOUDSTACK-3539
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-3539
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Affects Versions: 4.2.0
> Reporter: Sheng Yang
> Priority: Blocker
> Fix For: 4.2.0
>
>
> It's caused by:
> commit 4e4112fcecc4f2791ec99b774f81988f8c416d77
> Author: Edison Su <[email protected]>
> Date: Thu May 23 13:51:14 2013 -0700
> fix attach volume for kvm
> diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java
> b/server/src/com/cloud/server/ConfigurationServerImpl.java
> index bc52e9a..98f1c96 100755
> --- a/server/src/com/cloud/server/ConfigurationServerImpl.java
> +++ b/server/src/com/cloud/server/ConfigurationServerImpl.java
> @@ -224,9 +224,20 @@ public class ConfigurationServerImpl extends ManagerBase
> implements Configuratio
> }
>
> String hostIpAdr = NetUtils.getDefaultHostIp();
> + boolean needUpdateHostIp = true;
> if (hostIpAdr != null) {
> - _configDao.update(Config.ManagementHostIPAdr.key(),
> Config.ManagementHostIPAdr.getCategory(), hostIpAdr);
> - s_logger.debug("ConfigurationServer saved \"" + hostIpAdr +
> "\" as host.");
> + Boolean devel =
> Boolean.valueOf(_configDao.getValue("developer"));
> + if (devel) {
> + String value =
> _configDao.getValue(Config.ManagementHostIPAdr.key());
> + if (value != null) {
> + needUpdateHostIp = false;
> + }
> + }
> +
> + if (needUpdateHostIp) {
> + _configDao.update(Config.ManagementHostIPAdr.key(),
> Config.ManagementHostIPAdr.getCategory(), hostIpAdr);
> + s_logger.debug("ConfigurationServer saved \"" +
> hostIpAdr + "\" as host.");
> + }
> }
> If devel is true, value would be checked against null, but the default value
> is "localhost" for my machine, so the IP wouldn't be picked up then e.g. SSVM
> cannot connect to mgmt server.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira