Index: cluster/cli/src/test/java/com/sun/enterprise/admin/cli/cluster/LocalInstanceCommandTest.java =================================================================== --- cluster/cli/src/test/java/com/sun/enterprise/admin/cli/cluster/LocalInstanceCommandTest.java (revision 43760) +++ cluster/cli/src/test/java/com/sun/enterprise/admin/cli/cluster/LocalInstanceCommandTest.java (working copy) @@ -84,6 +84,7 @@ try { nodeDir = nodeAgentsDir.getAbsolutePath(); instanceName = "i1"; + isCreateInstanceFilesystem = true; validate(); } catch(CommandException e) { Index: cluster/cli/src/main/java/com/sun/enterprise/admin/cli/cluster/CreateLocalInstanceFilesystemCommand.java =================================================================== --- cluster/cli/src/main/java/com/sun/enterprise/admin/cli/cluster/CreateLocalInstanceFilesystemCommand.java (revision 43760) +++ cluster/cli/src/main/java/com/sun/enterprise/admin/cli/cluster/CreateLocalInstanceFilesystemCommand.java (working copy) @@ -92,6 +92,8 @@ else throw new CommandException(Strings.get("Instance.badInstanceName")); + isCreateInstanceFilesystem = true; + super.validate(); String agentPath = "agent" + File.separator + "config"; Index: cluster/cli/src/main/java/com/sun/enterprise/admin/cli/cluster/LocalInstanceCommand.java =================================================================== --- cluster/cli/src/main/java/com/sun/enterprise/admin/cli/cluster/LocalInstanceCommand.java (revision 43760) +++ cluster/cli/src/main/java/com/sun/enterprise/admin/cli/cluster/LocalInstanceCommand.java (working copy) @@ -101,6 +101,7 @@ protected File nodeDirChild; // the specific node dir protected File instanceDir; // the specific instance dir protected String domainName; + protected boolean isCreateInstanceFilesystem = false; private InstanceDirs instanceDirs; @Override @@ -521,26 +522,32 @@ /* * If there is no existing node dir child -- create one! * If the instance is on the same machine as DAS, use "localhost" as the node dir child + * Only for _create-instance-filesystem */ - try { - String dashost = null; - if (programOpts != null) { - dashost = programOpts.getHost(); - } - String hostname = InetAddress.getLocalHost().getHostName(); - if (hostname.equals(dashost) || NetUtils.isThisHostLocal(dashost)) { - hostname = "localhost" + "-" + domainName; - } - File f = new File(parent, hostname); + if (isCreateInstanceFilesystem) { + try { + String dashost = null; + if (programOpts != null) { + dashost = programOpts.getHost(); + } + String hostname = InetAddress.getLocalHost().getHostName(); + if (hostname.equals(dashost) || NetUtils.isThisHostLocal(dashost)) { + hostname = "localhost" + "-" + domainName; + } + File f = new File(parent, hostname); - if (!mkdirs(f) || !isDirectory(f)) // for instance there is a regular file with that name - throw new CommandException(Strings.get("cantCreateNodeDirChild", f)); + if (!mkdirs(f) || !isDirectory(f)) // for instance there is a regular file with that name + { + throw new CommandException(Strings.get("cantCreateNodeDirChild", f)); + } - return f; + return f; + } catch (UnknownHostException ex) { + throw new CommandException(Strings.get("cantGetHostName", ex)); + } + } else { + throw new CommandException(Strings.get("DeleteInstance.noInstance")); } - catch (UnknownHostException ex) { - throw new CommandException(Strings.get("cantGetHostName", ex)); - } } private File getTheOneAndOnlyInstance(File parent) throws CommandException {