Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions KnownIssues.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
The following list are known issues. The issue may contain a work-around or an associated Issue number.

**ISSUE**:
The createDomain and updateDomain tools cannot target non-JRF product resources to dynamic clusters because
WebLogic WLST will not assign resources associated with extension or custom template user server groups
to dynamic clusters. Resources associated to JRF user server groups defined in the domain typedef
(i.e. JRF, RestrictedJRF) will be targeted to the dynamic cluster by the WDT tools using the FMW WLST function
applyJRF.

If you have only non-JRF user server groups targeted to a dynamic cluster, you will see the following message:

WLSDPLY-12238: Unable to target non-JRF template server groups for domain type <your domain typedef> to dynamic cluster(s).

You will not see this message if you have a mix of non-JRF and JRF user server groups targeted to the dynamic
cluster. WDT cannot detect if a user server group is associated to JRF, and therefore, whether the applyJRF will
target the user group resources to the dynamic cluster.

**ACTION**:

You must contact WebLogic support to assist you with a solution for this targeting dilemma. You can perform
the following action as a temporary work-around to the described issue.

1. Add a configured managed server to your dynamic cluster and re-run the createDomain or updateDomain tool.
The dynamic cluster becomes a "mixed" cluster once the managed server is added. When the WDT tool targets the
user server groups to the configured managed server, the resources are automatically targeted to the cluster
by WebLogic, which includes both the managed server and the dynamic servers.

**ISSUE**:
The discoverDomain STDOUT contains many SEVERE messages about cd() and ls() when it is run against a 12.2.1 domain.
The discover tool navigates through the domain MBeans using wlst to determine which MBeans are present in a
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/python/wlsdeploy/tool/create/domain_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,13 +487,13 @@ def __create_domain_with_select_template(self, domain_home):

server_groups_to_target = self._domain_typedef.get_server_groups_to_target()
server_assigns, dynamic_assigns = self.target_helper.target_server_groups_to_servers(server_groups_to_target)
if server_assigns is not None:
if len(server_assigns) > 0:
self.target_helper.target_server_groups(server_assigns)

self.wlst_helper.write_domain(domain_home)
self.wlst_helper.close_template()

if dynamic_assigns is not None:
if len(dynamic_assigns) > 0:
self.target_helper.target_server_groups_to_dynamic_clusters(dynamic_assigns)

self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ def update(self):
server_groups_to_target = self._domain_typedef.get_server_groups_to_target()
server_assigns, dynamic_assigns = \
self.target_helper.target_server_groups_to_servers(server_groups_to_target)
if dynamic_assigns is not None:
if len(dynamic_assigns) > 0:
self.wlst_helper.save_and_close(self.model_context)
self.target_helper.target_server_groups_to_dynamic_clusters(dynamic_assigns)
self.wlst_helper.reopen(self.model_context)
if server_assigns is not None:
if len(server_assigns) > 0:
self.target_helper.target_server_groups(server_assigns)
elif self._domain_typedef.is_jrf_domain_type():
self.target_helper.target_jrf_groups_to_clusters_servers()
Expand Down
118 changes: 76 additions & 42 deletions core/src/main/python/wlsdeploy/tool/util/target_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

import copy
import oracle.weblogic.deploy.util.StringUtils as StringUtils

import oracle.weblogic.deploy.util.PyOrderedDict as OrderedDict
import wlsdeploy.util.dictionary_utils as dictionary_utils

Expand All @@ -16,7 +16,6 @@
from wlsdeploy.aliases.model_constants import MODEL_LIST_DELIMITER
from wlsdeploy.aliases.model_constants import SERVER
from wlsdeploy.aliases.model_constants import SERVER_GROUP_TARGETING_LIMITS
from wlsdeploy.exception import exception_helper
from wlsdeploy.tool.util.alias_helper import AliasHelper
from wlsdeploy.tool.util.wlst_helper import WlstHelper
from wlsdeploy.util import string_utils
Expand Down Expand Up @@ -140,32 +139,52 @@ def target_server_groups_to_servers(self, server_groups_to_target):
method_name=_method_name)

final_assignment_map = dict()
if len(server_names) > 0:
dynamic_cluster_assigns = dict()
# Target servers and dynamic clusters to the server group resources
if len(server_names) > 0 or len(dynamic_cluster_names) > 0:
for server, server_groups in server_to_server_groups_map.iteritems():
if server in server_names and len(server_groups) > 0:
final_assignment_map[server] = server_groups

elif len(server_names) == 0 and len(dynamic_cluster_names) == 0:
#
# Domain has no managed servers and there were not targeting limits specified to target
# server groups to the admin server so make sure that the server groups are targeted to
# the admin server.
#
# This is really a best effort attempt. It works for JRF domains but it is certainly possible
# that it may cause problems with other custom domain types. Of course, creating a domain with
# no managed servers is not a primary use case of this tool so do it and hope for the best...
#
final_assignment_map[server_names[0]] = server_groups_to_target

# Target any dynamic clusters to the server group resources
dynamic_cluster_assigns = None
if len(dynamic_cluster_names) > 0:
dynamic_cluster_assigns = dict()
for name in dynamic_cluster_names:
if name in server_to_server_groups_map:
dynamic_cluster_assigns[name] = server_to_server_groups_map[name]

self.logger.exiting(result=str(dynamic_cluster_assigns), class_name=self.__class_name, method_name=_method_name)
if len(server_groups) > 0:
if server in server_names:
final_assignment_map[server] = server_groups
elif server in dynamic_cluster_names:
dynamic_cluster_assigns[server] = server_groups

#
# Domain has not targeted the server groups to managed servers (configured), or the
# domain has no managed servers (configured) but has user server groups. The resources for the
# user server groups must be targeted before the write/update domain or the write/update will fail.
# Thus assign the user server groups to the admin server.
#
# Because of the interaction of the working context in the different wlst helpers, the dynamic
# clusters will be applied to the resources separately and after the write/update domain.
#
# (From original blurb)
# This is really a best effort attempt. It works for JRF domains but it is certainly possible
# that it may cause problems with other custom domain types. Of course, creating a domain with
# no managed servers is not a primary use case of this tool so do it and hope for the best...
#
# (New comment)
# As we have added the intricacies of the dynamic clusters, if the targeting is to dynamic
# clusters only, the set server groups with the admin server will get through the write/update domain
# and the applyJRF with the dynamic cluster should theoretically unset the AdminServer on the user server
# groups. It works with JRF type domains.

if len(server_groups_to_target) > 0:
if len(final_assignment_map) == 0:
# This is a quickie to fix the issue where server groups are not targeted because no configured
# managed servers exist in the domain
final_assignment_map[server_names[0]] = server_groups_to_target
else:
# If a server group or groups is not targeted in the assignments, log it to stdout
no_targets = [server_target for server_target in server_groups_to_target if server_target not in
[server_target for row in final_assignment_map.itervalues() for
server_target in server_groups_to_target if server_target in row]]
if len(no_targets) > 0:
self.logger.info('WLSDPLY-12248', no_targets,
class_name=self.__class_name, method_name=_method_name)

self.logger.exiting(result=str(dynamic_cluster_assigns),
class_name=self.__class_name, method_name=_method_name)
return final_assignment_map, dynamic_cluster_assigns

def target_server_groups(self, server_assigns):
Expand Down Expand Up @@ -200,15 +219,14 @@ def target_server_groups_to_dynamic_clusters(self, dynamic_cluster_assigns):
domain_typedef = self.model_context.get_domain_typedef()

if len(dynamic_cluster_assigns) > 0:
self.logger.info('WLSDPLY-12247', class_name=self.__class_name, method_name=_method_name)
# TBD assign server group resources to cluster. The JRF resources could still be applied separately
# using this technique - or remove this technique and replace with the resource targeting
if domain_typedef.has_jrf_resources():
self._target_jrf_resources(dynamic_cluster_assigns)
else:
ex = exception_helper.create_exception(self.exception_type, 'WLSDPLY-12238',
domain_typedef.get_domain_type())
self.logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
raise ex
self.logger.warning('WLSDPLY-12238', domain_typedef.get_domain_type(),
class_name=self.__class_name, method_name=_method_name)

self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
return
Expand Down Expand Up @@ -357,7 +375,7 @@ def _get_server_group_targeting_limits(self, server_group_targeting_limits, clus
if DYNAMIC_SERVERS in cluster_members:
# This will need special handling to target server group resources
cluster_members.remove(DYNAMIC_SERVERS)
cluster_members.add(target_name)
cluster_members.append(target_name)
new_list.extend(cluster_members)
else:
# Assume it is a server name and add it to the new list
Expand Down Expand Up @@ -385,28 +403,47 @@ def _get_server_to_server_groups_map(self, admin_server_name, server_names, dyna
self.logger.entering(admin_server_name, str(server_names), str(server_groups), str(sg_targeting_limits),
class_name=self.__class_name, method_name=_method_name)
result = OrderedDict()
revised_server_groups = self._revised_list_server_groups(server_groups, sg_targeting_limits)
for server_name in server_names:
server_groups_for_server = self.__get_server_groups_for_entity(server_name, sg_targeting_limits)
if server_groups_for_server is not None:
if len(server_groups_for_server) > 0:
result[server_name] = server_groups_for_server
elif server_name != admin_server_name:
# By default, we only target managed servers unless explicitly listed in the targeting limits
result[server_name] = list(server_groups)
result[server_name] = list(revised_server_groups)
else:
result[admin_server_name] = list()
for cluster_name in dynamic_cluster_names:
server_groups_for_cluster = self.__get_server_groups_for_entity(cluster_name, sg_targeting_limits)
if server_groups_for_cluster is not None:
server_groups_for_cluster = \
self.__get_server_groups_for_entity(cluster_name, sg_targeting_limits)
if len(server_groups_for_cluster) > 0:
result[cluster_name] = server_groups_for_cluster
else:
result[cluster_name] = list(server_groups)
result[cluster_name] = list(revised_server_groups)
self.logger.finer('WLSDPLY-12239', result[cluster_name], cluster_name,
class_name=self.__class_name, method_name=_method_name)
if admin_server_name not in result:
result[admin_server_name] = list()
self.logger.exiting(class_name=self.__class_name, method_name=_method_name, result=result)
return result

def _revised_list_server_groups(self, server_groups, sg_targeting_limits):
"""
Remove all server groups that are explicitly targeted to a cluster, server set or stand-alone
managed server.
:param server_groups: list of server groups applied by the extension templates
:param sg_targeting_limits: list of targeting from the domainInfo section
:return: server group list with the specific targeted server groups removed
"""
_method_name = '_revised_list_server_groups'
self.logger.entering(sg_targeting_limits, class_name=self.__class_name, method_name=_method_name)
result = list()
targeted_server_groups = sg_targeting_limits.keys()
for server_group in server_groups:
if server_group not in targeted_server_groups:
result.append(server_group)
return result

def __get_server_groups_for_entity(self, entity_name, sg_targeting_limits):
"""
Get the servers groups to target for a given server or dynamic cluster name.
Expand All @@ -416,14 +453,11 @@ def __get_server_groups_for_entity(self, entity_name, sg_targeting_limits):
if the entity name does not appear in the targeting limits
"""
_method_name = '__get_server_groups_for_entity'

result = None
result = list()
for server_group, entity_names_list in sg_targeting_limits.iteritems():
if entity_name in entity_names_list:
if result is None:
result = list()
result.append(server_group)
if result is not None:
if len(result) > 0:
self.logger.fine('WLSDPLY-12243', entity_name, result, class_name=self.__class_name,
method_name=_method_name)
return result
Original file line number Diff line number Diff line change
Expand Up @@ -1073,8 +1073,8 @@ WLSDPLY-12234=Unable to copy domain library {0} to directory {1}
WLSDPLY-12235=Installing domain library {0} to lib directory of {1}
WLSDPLY-12236=Target the JRF resources to the clusters with dynamic servers {0}
WLSDPLY-12237=Target the resources for server groups {0} to cluster {1} with dynamic server members
WLSDPLY-12238=Unable to target template server groups for domain type {0} to dynamic clusters. This will \
be available in a follow-up release of WebLogic Deploy Tooling.
WLSDPLY-12238=Unable to target non-JRF template server groups for domain type {0} to dynamic cluster(s).

WLSDPLY-12239=Found server groups {0} for cluster {1}
WLSDPLY-12240=Server group targeting limits {0} found in model
WLSDPLY-12242=The assignment of servers to server groups map is {0}
Expand All @@ -1083,6 +1083,9 @@ WLSDPLY-12244=Targeting JRF resources to a dynamic cluster(s), {0}, for a Restri
when updating in online mode
WLSDPLY-12245=Selecting custom extension template named {0}
WLSDPLY-12246=Adding custom extension template file {0} to domain
WLSDPLY-12247=WebLogic does not support targeting resources to dynamic servers. JRF product related resources \
will be targeted to the dynamic cluster using the applyJRF function.
WLSDPLY-12248=The server group(s) {0} will not be targeted to the Admin server or a configured manage server

# domain_typedef.py
WLSDPLY-12300={0} got the domain type {1} but the domain type definition file {2} was not valid: {3}
Expand Down