From e9cfa6891b37a37eaa6d5c7b473b892ccd681134 Mon Sep 17 00:00:00 2001 From: Dilshat Date: Mon, 20 Nov 2017 18:27:51 +0600 Subject: [PATCH 1/4] #2128 --- .../adapter/ProxyEnvironmentContainer.java | 4 +- .../impl/entity/EnvironmentContainerImpl.java | 19 ++++++++++ .../creation/steps/ContainerCloneStep.java | 2 +- .../entity/EnvironmentContainerImplTest.java | 4 +- .../impl/entity/ContainerInfoImpl.java | 12 ++++++ .../rest/transitional/ContainerInfoJson.java | 9 +++++ .../core/localpeer/impl/LocalPeerImpl.java | 5 ++- .../impl/entity/ContainerHostEntity.java | 22 ++++++++++- .../impl/entity/ResourceHostEntity.java | 2 +- .../CreateEnvironmentContainersResponse.java | 6 ++- .../common/host/ContainerHostInfo.java | 4 ++ .../common/host/ContainerHostInfoModel.java | 38 +++++++++++++++---- .../io/subutai/common/task/CloneResponse.java | 12 +++++- 13 files changed, 118 insertions(+), 21 deletions(-) diff --git a/management/server/core/environment-manager/environment-manager-impl/src/main/java/io/subutai/core/environment/impl/adapter/ProxyEnvironmentContainer.java b/management/server/core/environment-manager/environment-manager-impl/src/main/java/io/subutai/core/environment/impl/adapter/ProxyEnvironmentContainer.java index 684c61db98f..449eb255088 100644 --- a/management/server/core/environment-manager/environment-manager-impl/src/main/java/io/subutai/core/environment/impl/adapter/ProxyEnvironmentContainer.java +++ b/management/server/core/environment-manager/environment-manager-impl/src/main/java/io/subutai/core/environment/impl/adapter/ProxyEnvironmentContainer.java @@ -45,11 +45,11 @@ class ProxyEnvironmentContainer extends EnvironmentContainerImpl ProxyEnvironmentContainer( JsonNode json, EnvironmentManagerImpl environmentManager, Set localContainerIds ) { - + //TODO pass env id and vlan from Hub super( Common.HUB_ID, json.get( "peerId" ).asText(), new ContainerHostInfoModel( json.get( "id" ).asText(), json.get( "hostName" ).asText(), json.get( "name" ).asText(), initHostInterfaces( json ), HostArchitecture.AMD64, - ContainerHostState.RUNNING ), json.get( "templateId" ).asText(), + ContainerHostState.RUNNING, null, null ), json.get( "templateId" ).asText(), json.get( "domainName" ).asText(), new ContainerQuota( parseSize( json ) ), json.get( "hostId" ).asText() ); diff --git a/management/server/core/environment-manager/environment-manager-impl/src/main/java/io/subutai/core/environment/impl/entity/EnvironmentContainerImpl.java b/management/server/core/environment-manager/environment-manager-impl/src/main/java/io/subutai/core/environment/impl/entity/EnvironmentContainerImpl.java index 521119af7f5..9de6c943e93 100644 --- a/management/server/core/environment-manager/environment-manager-impl/src/main/java/io/subutai/core/environment/impl/entity/EnvironmentContainerImpl.java +++ b/management/server/core/environment-manager/environment-manager-impl/src/main/java/io/subutai/core/environment/impl/entity/EnvironmentContainerImpl.java @@ -95,6 +95,10 @@ public class EnvironmentContainerImpl implements EnvironmentContainerHost @JsonProperty( "containerName" ) private String containerName; + @Column( name = "vlan" ) + @JsonProperty( "vlan" ) + private Integer vlan; + @Column( name = "creator_peer_id", nullable = false ) @JsonIgnore @@ -186,6 +190,7 @@ public EnvironmentContainerImpl( final String initiatorPeerId, final String peer this.domainName = domainName; this.containerSize = containerQuota.getContainerSize(); this.resourceHostId = resourceHostId; + this.vlan = hostInfo.getVlan(); setHostInterfaces( hostInfo.getHostInterfaces() ); } @@ -206,6 +211,13 @@ public Quota getRawQuota() } + @Override + public Integer getVlan() + { + return vlan; + } + + @Override public Integer getDomainPort() { @@ -263,6 +275,13 @@ public EnvironmentId getEnvironmentId() } + @Override + public String getEnvId() + { + return parent.getId(); + } + + @Override public ContainerHostState getState() { diff --git a/management/server/core/environment-manager/environment-manager-impl/src/main/java/io/subutai/core/environment/impl/workflow/creation/steps/ContainerCloneStep.java b/management/server/core/environment-manager/environment-manager-impl/src/main/java/io/subutai/core/environment/impl/workflow/creation/steps/ContainerCloneStep.java index 8baf3159124..5671dffeddf 100644 --- a/management/server/core/environment-manager/environment-manager-impl/src/main/java/io/subutai/core/environment/impl/workflow/creation/steps/ContainerCloneStep.java +++ b/management/server/core/environment-manager/environment-manager-impl/src/main/java/io/subutai/core/environment/impl/workflow/creation/steps/ContainerCloneStep.java @@ -180,7 +180,7 @@ protected EnvironmentContainerImpl buildContainerEntity( final String peerId, fi final ContainerHostInfoModel infoModel = new ContainerHostInfoModel( cloneResponse.getContainerId(), cloneResponse.getHostname(), cloneResponse.getContainerName(), interfaces, cloneResponse.getTemplateArch(), - ContainerHostState.RUNNING ); + ContainerHostState.RUNNING, environment.getId(), cloneResponse.getVlan() ); return new EnvironmentContainerImpl( localPeerId, peerId, infoModel, cloneResponse.getTemplateId(), defaultDomain, cloneResponse.getContainerQuota(), cloneResponse.getResourceHostId() ); diff --git a/management/server/core/environment-manager/environment-manager-impl/src/test/java/io/subutai/core/environment/impl/entity/EnvironmentContainerImplTest.java b/management/server/core/environment-manager/environment-manager-impl/src/test/java/io/subutai/core/environment/impl/entity/EnvironmentContainerImplTest.java index a72680db17c..5de0d48241a 100644 --- a/management/server/core/environment-manager/environment-manager-impl/src/test/java/io/subutai/core/environment/impl/entity/EnvironmentContainerImplTest.java +++ b/management/server/core/environment-manager/environment-manager-impl/src/test/java/io/subutai/core/environment/impl/entity/EnvironmentContainerImplTest.java @@ -54,7 +54,7 @@ public class EnvironmentContainerImplTest private static final String HOSTNAME = "container1"; private static final ContainerHostState STATE = ContainerHostState.RUNNING; private static final String TAG = "tag"; - private static final int PID = 123; + private static final int VLAN = 123; private EnvironmentContainerImpl environmentContainer; @@ -85,7 +85,7 @@ public void setUp() throws Exception ContainerHostInfoModel containerHostInfoModel = new ContainerHostInfoModel( CONTAINER_ID, HOSTNAME, HOSTNAME, hostInterfaces, HostArchitecture.AMD64, - STATE ); + STATE, ENV_ID, VLAN ); environmentContainer = spy( new EnvironmentContainerImpl( INITIATOR_ID, PEER_ID, containerHostInfoModel, TEMPLATE_ID, diff --git a/management/server/core/host-registration/host-registration-impl/src/main/java/io/subutai/core/registration/impl/entity/ContainerInfoImpl.java b/management/server/core/host-registration/host-registration-impl/src/main/java/io/subutai/core/registration/impl/entity/ContainerInfoImpl.java index 4d3a1868b08..1e91dc63582 100644 --- a/management/server/core/host-registration/host-registration-impl/src/main/java/io/subutai/core/registration/impl/entity/ContainerInfoImpl.java +++ b/management/server/core/host-registration/host-registration-impl/src/main/java/io/subutai/core/registration/impl/entity/ContainerInfoImpl.java @@ -63,6 +63,10 @@ public class ContainerInfoImpl implements ContainerInfo @Expose private Integer vlan; + @Column( name = "envId" ) + @Expose + private String envId; + @Column( name = "gateway" ) @Expose private String gateway = ""; @@ -115,6 +119,7 @@ public ContainerInfoImpl( ContainerInfo hostInfo ) this.status = hostInfo.getStatus(); this.publicKey = hostInfo.getPublicKey(); this.gateway = hostInfo.getGateway(); + this.envId = hostInfo.getEnvId(); if ( arch == null ) { arch = HostArchitecture.AMD64; @@ -234,6 +239,13 @@ public Integer getVlan() } + @Override + public String getEnvId() + { + return envId; + } + + @Override public String getGateway() { diff --git a/management/server/core/host-registration/host-registration-rest/src/main/java/io/subutai/core/registration/rest/transitional/ContainerInfoJson.java b/management/server/core/host-registration/host-registration-rest/src/main/java/io/subutai/core/registration/rest/transitional/ContainerInfoJson.java index b499539e445..6e938ae8390 100644 --- a/management/server/core/host-registration/host-registration-rest/src/main/java/io/subutai/core/registration/rest/transitional/ContainerInfoJson.java +++ b/management/server/core/host-registration/host-registration-rest/src/main/java/io/subutai/core/registration/rest/transitional/ContainerInfoJson.java @@ -21,6 +21,7 @@ public class ContainerInfoJson implements ContainerInfo private String hostname; private String name; private Integer vlan; + private String envId; private String templateName; private Set interfaces = new HashSet<>(); private HostArchitecture arch; @@ -44,6 +45,7 @@ public class ContainerInfoJson implements ContainerInfo this.gateway = hostInfo.getGateway(); this.state = hostInfo.getState(); this.quota = hostInfo.getRawQuota(); + this.envId = hostInfo.getEnvId(); if ( arch == null ) { arch = HostArchitecture.AMD64; @@ -135,6 +137,13 @@ public Integer getVlan() } + @Override + public String getEnvId() + { + return envId; + } + + @Override public String getPublicKey() { diff --git a/management/server/core/local-peer/local-peer-impl/src/main/java/io/subutai/core/localpeer/impl/LocalPeerImpl.java b/management/server/core/local-peer/local-peer-impl/src/main/java/io/subutai/core/localpeer/impl/LocalPeerImpl.java index 5991c59407b..580c2ae8ef0 100644 --- a/management/server/core/local-peer/local-peer-impl/src/main/java/io/subutai/core/localpeer/impl/LocalPeerImpl.java +++ b/management/server/core/local-peer/local-peer-impl/src/main/java/io/subutai/core/localpeer/impl/LocalPeerImpl.java @@ -1150,13 +1150,14 @@ public CreateEnvironmentContainersResponse createEnvironmentContainers( request.getHostname(), request.getTemplateArch(), interfaces, request.getContainerName(), request.getTemplateId(), requestGroup.getEnvironmentId(), requestGroup.getOwnerId(), - requestGroup.getInitiatorPeerId(), request.getContainerQuota() ); + requestGroup.getInitiatorPeerId(), request.getContainerQuota(), + reservedNetworkResource.getVlan() ); registerContainer( request.getResourceHostId(), containerHostEntity ); } } - return new CreateEnvironmentContainersResponse( cloneResults ); + return new CreateEnvironmentContainersResponse( cloneResults, reservedNetworkResource ); } finally { diff --git a/management/server/core/local-peer/local-peer-impl/src/main/java/io/subutai/core/localpeer/impl/entity/ContainerHostEntity.java b/management/server/core/local-peer/local-peer-impl/src/main/java/io/subutai/core/localpeer/impl/entity/ContainerHostEntity.java index 739a509bc09..7d5a283f468 100644 --- a/management/server/core/local-peer/local-peer-impl/src/main/java/io/subutai/core/localpeer/impl/entity/ContainerHostEntity.java +++ b/management/server/core/local-peer/local-peer-impl/src/main/java/io/subutai/core/localpeer/impl/entity/ContainerHostEntity.java @@ -72,6 +72,9 @@ public class ContainerHostEntity extends AbstractSubutaiHost implements Containe @Column( name = "env_id", nullable = true ) private String environmentId; + @Column( name = "vlan", nullable = true ) + private Integer vlan; + @Column( name = "initiator_peer_id", nullable = true ) private String initiatorPeerId; @@ -99,6 +102,20 @@ protected ContainerHostEntity() } + @Override + public Integer getVlan() + { + return vlan; + } + + + @Override + public String getEnvId() + { + return environmentId; + } + + @Override public HostId getResourceHostId() { @@ -116,8 +133,8 @@ public String getContainerName() public ContainerHostEntity( final String peerId, final String hostId, final String hostname, HostArchitecture architecture, HostInterfaces hostInterfaces, final String containerName, final String templateId, final String environmentId, - final String ownerId, final String initiatorPeerId, - final ContainerQuota containerQuota ) + final String ownerId, final String initiatorPeerId, final ContainerQuota containerQuota, + final Integer vlan ) { super( peerId, hostId, hostname, architecture ); this.containerName = containerName; @@ -126,6 +143,7 @@ public ContainerHostEntity( final String peerId, final String hostId, final Stri this.initiatorPeerId = initiatorPeerId; this.ownerId = ownerId; this.containerSize = containerQuota.getContainerSize(); + this.vlan = vlan; setSavedHostInterfaces( hostInterfaces ); } diff --git a/management/server/core/local-peer/local-peer-impl/src/main/java/io/subutai/core/localpeer/impl/entity/ResourceHostEntity.java b/management/server/core/local-peer/local-peer-impl/src/main/java/io/subutai/core/localpeer/impl/entity/ResourceHostEntity.java index 94e64cbdbb6..d873056dff4 100644 --- a/management/server/core/local-peer/local-peer-impl/src/main/java/io/subutai/core/localpeer/impl/entity/ResourceHostEntity.java +++ b/management/server/core/local-peer/local-peer-impl/src/main/java/io/subutai/core/localpeer/impl/entity/ResourceHostEntity.java @@ -1005,7 +1005,7 @@ public void updateHostInfo( final HostInfo hostInfo ) info.getHostInterfaces(), info.getContainerName(), getLocalPeer().getTemplateByName( Common.MANAGEMENT_HOSTNAME ).getId(), Common.MANAGEMENT_HOSTNAME, null, null, - new ContainerQuota( ContainerSize.SMALL ) ); + new ContainerQuota( ContainerSize.SMALL ), info.getVlan() ); addContainerHost( containerHost ); } diff --git a/management/server/subutai-common/src/main/java/io/subutai/common/environment/CreateEnvironmentContainersResponse.java b/management/server/subutai-common/src/main/java/io/subutai/common/environment/CreateEnvironmentContainersResponse.java index 26d2bc1674d..bc9c679e421 100644 --- a/management/server/subutai-common/src/main/java/io/subutai/common/environment/CreateEnvironmentContainersResponse.java +++ b/management/server/subutai-common/src/main/java/io/subutai/common/environment/CreateEnvironmentContainersResponse.java @@ -7,6 +7,7 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Sets; +import io.subutai.common.network.NetworkResource; import io.subutai.common.task.CloneRequest; import io.subutai.common.task.CloneResponse; import io.subutai.common.util.HostUtil; @@ -34,7 +35,7 @@ public CreateEnvironmentContainersResponse( @JsonProperty( value = "messages" ) } - public CreateEnvironmentContainersResponse( HostUtil.Results results ) + public CreateEnvironmentContainersResponse( HostUtil.Results results, NetworkResource networkResource ) { Preconditions.checkNotNull( results ); @@ -48,7 +49,8 @@ public CreateEnvironmentContainersResponse( HostUtil.Results results ) { responses.add( new CloneResponse( task.getHost().getId(), request.getHostname(), request.getContainerName(), request.getTemplateId(), request.getTemplateArch(), request.getIp(), - cloneContainerTask.getResult(), task.getDuration(), request.getContainerQuota() ) ); + cloneContainerTask.getResult(), task.getDuration(), request.getContainerQuota(), + networkResource.getVlan() ) ); this.messages.add( String .format( "Task (%s) succeeded on host %s [%s]", task.name(), task.getHost().getHostname(), diff --git a/management/server/subutai-common/src/main/java/io/subutai/common/host/ContainerHostInfo.java b/management/server/subutai-common/src/main/java/io/subutai/common/host/ContainerHostInfo.java index 15f16fbdb5b..5c99fd71da5 100644 --- a/management/server/subutai-common/src/main/java/io/subutai/common/host/ContainerHostInfo.java +++ b/management/server/subutai-common/src/main/java/io/subutai/common/host/ContainerHostInfo.java @@ -25,4 +25,8 @@ public interface ContainerHostInfo extends HostInfo * Returns network interfaces of host */ HostInterfaces getHostInterfaces(); + + String getEnvId(); + + Integer getVlan(); } diff --git a/management/server/subutai-common/src/main/java/io/subutai/common/host/ContainerHostInfoModel.java b/management/server/subutai-common/src/main/java/io/subutai/common/host/ContainerHostInfoModel.java index 48424f682ed..7e830d34ece 100644 --- a/management/server/subutai-common/src/main/java/io/subutai/common/host/ContainerHostInfoModel.java +++ b/management/server/subutai-common/src/main/java/io/subutai/common/host/ContainerHostInfoModel.java @@ -27,13 +27,10 @@ public class ContainerHostInfoModel extends HostInfoModel implements ContainerHo @SerializedName( "interfaces" ) @JsonProperty( "interfaces" ) protected Set hostInterfaces = new HashSet<>(); - - - @Override - public Quota getRawQuota() - { - return quota; - } + @JsonProperty( "environmentId" ) + protected String envId; + @JsonProperty( "vlan" ) + protected Integer vlan; public ContainerHostInfoModel( @JsonProperty( "id" ) final String id, @@ -41,15 +38,40 @@ public ContainerHostInfoModel( @JsonProperty( "id" ) final String id, @JsonProperty( "containerName" ) final String containerName, @JsonProperty( "interfaces" ) final HostInterfaces hostInterfaces, @JsonProperty( "arch" ) final HostArchitecture hostArchitecture, - @JsonProperty( "status" ) final ContainerHostState state ) + @JsonProperty( "status" ) final ContainerHostState state, + @JsonProperty( "envId" ) final String envId, + @JsonProperty( "vlan" ) final Integer vlan ) { super( id, hostname, hostArchitecture ); this.state = state; this.name = containerName; + this.envId = envId; + this.vlan = vlan; setHostInterfaces( hostInterfaces ); } + @Override + public Quota getRawQuota() + { + return quota; + } + + + @Override + public String getEnvId() + { + return envId; + } + + + @Override + public Integer getVlan() + { + return vlan; + } + + @Override public HostInterfaces getHostInterfaces() { diff --git a/management/server/subutai-common/src/main/java/io/subutai/common/task/CloneResponse.java b/management/server/subutai-common/src/main/java/io/subutai/common/task/CloneResponse.java index 9c56c0ae253..345eae6f7e0 100644 --- a/management/server/subutai-common/src/main/java/io/subutai/common/task/CloneResponse.java +++ b/management/server/subutai-common/src/main/java/io/subutai/common/task/CloneResponse.java @@ -40,6 +40,8 @@ public class CloneResponse implements TaskResponse @JsonProperty( value = "containerQuota" ) private ContainerQuota containerQuota; + @JsonProperty( value = "vlan" ) + private Integer vlan; public CloneResponse( @JsonProperty( value = "resourceHostId" ) final String resourceHostId, @@ -50,7 +52,8 @@ public CloneResponse( @JsonProperty( value = "resourceHostId" ) final String res @JsonProperty( value = "ip" ) final String ip, @JsonProperty( value = "containerId" ) final String containerId, @JsonProperty( value = "elapsedTime" ) final long elapsedTime, - @JsonProperty( value = "containerQuota" ) final ContainerQuota containerQuota ) + @JsonProperty( value = "containerQuota" ) final ContainerQuota containerQuota, + @JsonProperty( value = "vlan" ) final Integer vlan ) { this.resourceHostId = resourceHostId; this.hostname = hostname; @@ -61,6 +64,7 @@ public CloneResponse( @JsonProperty( value = "resourceHostId" ) final String res this.containerId = containerId; this.elapsedTime = elapsedTime; this.containerQuota = containerQuota; + this.vlan = vlan; } @@ -120,6 +124,12 @@ public ContainerQuota getContainerQuota() } + public Integer getVlan() + { + return vlan; + } + + @Override public String toString() { From a78fb1de9a7393aae706bb573fb23a8a8c074cd2 Mon Sep 17 00:00:00 2001 From: Dilshat Date: Tue, 21 Nov 2017 10:15:46 +0600 Subject: [PATCH 2/4] #2128 added vlan to output of host:list command --- .../io/subutai/core/hostregistry/cli/ListHostsCommand.java | 5 ++--- .../java/io/subutai/common/host/ContainerHostInfoModel.java | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/management/server/core/host-registry/host-registry-cli/src/main/java/io/subutai/core/hostregistry/cli/ListHostsCommand.java b/management/server/core/host-registry/host-registry-cli/src/main/java/io/subutai/core/hostregistry/cli/ListHostsCommand.java index da67a35da2a..b061d572437 100644 --- a/management/server/core/host-registry/host-registry-cli/src/main/java/io/subutai/core/hostregistry/cli/ListHostsCommand.java +++ b/management/server/core/host-registry/host-registry-cli/src/main/java/io/subutai/core/hostregistry/cli/ListHostsCommand.java @@ -10,7 +10,6 @@ import com.google.common.base.Preconditions; import io.subutai.common.host.ContainerHostInfo; -import io.subutai.common.host.HostInterface; import io.subutai.common.host.ResourceHostInfo; import io.subutai.common.settings.Common; import io.subutai.core.hostregistry.api.HostRegistry; @@ -58,10 +57,10 @@ protected Object doExecute() throws Exception containerHostInfo.getHostname() : containerHostInfo.getHostname() + " [ " + containerHostInfo.getContainerName() + " ]"; - System.out.println( String.format( "\t\t%s\t%s\t%s\t%s", hostname, + System.out.println( String.format( "\t\t%s\t%s\t%s\t%s\t%s", hostname, abbreviate ? StringUtils.abbreviate( containerHostInfo.getId(), 7 ) : containerHostInfo.getId(), containerHostInfo.getHostInterfaces().findByName( Common.DEFAULT_CONTAINER_INTERFACE ).getIp(), - containerHostInfo.getState() ) ); + containerHostInfo.getState(), containerHostInfo.getVlan() ) ); } System.out.println( "-------" ); diff --git a/management/server/subutai-common/src/main/java/io/subutai/common/host/ContainerHostInfoModel.java b/management/server/subutai-common/src/main/java/io/subutai/common/host/ContainerHostInfoModel.java index 7e830d34ece..d16880729e9 100644 --- a/management/server/subutai-common/src/main/java/io/subutai/common/host/ContainerHostInfoModel.java +++ b/management/server/subutai-common/src/main/java/io/subutai/common/host/ContainerHostInfoModel.java @@ -113,7 +113,7 @@ public String toString() { return MoreObjects.toStringHelper( this ).add( "id", id ).add( "hostname", hostname ) .add( "interfaces", hostInterfaces ).add( "status", state ).add( "arch", hostArchitecture ) - .toString(); + .add( "environmentId", envId ).add( "vlan", vlan ).toString(); } From 4cf0cca79416d080b265f7f36accd3d892350c9e Mon Sep 17 00:00:00 2001 From: Dilshat Date: Tue, 21 Nov 2017 11:23:42 +0600 Subject: [PATCH 3/4] #2128 added checking non-user containers by vlan and envId --- .../io/subutai/core/localpeer/impl/LocalPeerImpl.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/management/server/core/local-peer/local-peer-impl/src/main/java/io/subutai/core/localpeer/impl/LocalPeerImpl.java b/management/server/core/local-peer/local-peer-impl/src/main/java/io/subutai/core/localpeer/impl/LocalPeerImpl.java index 580c2ae8ef0..ee04491d481 100644 --- a/management/server/core/local-peer/local-peer-impl/src/main/java/io/subutai/core/localpeer/impl/LocalPeerImpl.java +++ b/management/server/core/local-peer/local-peer-impl/src/main/java/io/subutai/core/localpeer/impl/LocalPeerImpl.java @@ -3899,17 +3899,11 @@ private void removeStaleContainers() { ContainerHostInfo lostContainer = iterator.next(); - //TODO: use container-name and ip as a workaround for now to figure out environment containers, - //TODO: until env-id is present in container metadata from heartbeat //filter out containers created by system, not by user try { - if ( !( lostContainer.getContainerName().matches( ".*-\\d+-\\d+" ) - - && lostContainer.getHostInterfaces() - - .findByName( Common.DEFAULT_CONTAINER_INTERFACE ).getIp() - .startsWith( "172" ) ) ) + //system containers should have both vlan and envId + if ( lostContainer.getVlan() == null || lostContainer.getEnvId() == null ) { iterator.remove(); } From 54183cbff702b7c81efc21f263b9613f7191dc72 Mon Sep 17 00:00:00 2001 From: Dilshat Date: Tue, 21 Nov 2017 12:18:55 +0600 Subject: [PATCH 4/4] #2128 minor bugfix: fixed wrong json property name --- .../java/io/subutai/common/host/ContainerHostInfoModel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/management/server/subutai-common/src/main/java/io/subutai/common/host/ContainerHostInfoModel.java b/management/server/subutai-common/src/main/java/io/subutai/common/host/ContainerHostInfoModel.java index d16880729e9..ab248251b15 100644 --- a/management/server/subutai-common/src/main/java/io/subutai/common/host/ContainerHostInfoModel.java +++ b/management/server/subutai-common/src/main/java/io/subutai/common/host/ContainerHostInfoModel.java @@ -27,7 +27,7 @@ public class ContainerHostInfoModel extends HostInfoModel implements ContainerHo @SerializedName( "interfaces" ) @JsonProperty( "interfaces" ) protected Set hostInterfaces = new HashSet<>(); - @JsonProperty( "environmentId" ) + @JsonProperty( "envId" ) protected String envId; @JsonProperty( "vlan" ) protected Integer vlan;