Skip to content

Commit

Permalink
Implementation of MANAGED, MANAGED-NOVLAN, SYSTEM and STATIC in EUCANETD
Browse files Browse the repository at this point in the history
EUCA-10579
  • Loading branch information
gelinasc committed Mar 10, 2015
1 parent bd4eabf commit ee1b9a4
Show file tree
Hide file tree
Showing 117 changed files with 23,952 additions and 6,429 deletions.
176 changes: 174 additions & 2 deletions .cproject

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,14 @@ public VmRunType.Builder networkNames( List<NetworkGroup> list ) {
}
return this;
}


public VmRunType.Builder networkIds( List<NetworkGroup> list ) {
for ( NetworkGroup g : list ) {
this.buildit.getNetworkIds( ).add( g.getGroupId() );
}
return this;
}

public VmRunType.Builder naturalId( final String naturalId ) {
this.buildit.setUuid( naturalId );
return this;
Expand All @@ -168,6 +175,7 @@ public VmRunType create( ) {
checkParam( this.buildit.getLaunchIndex(), notNullValue() );
checkParam( this.buildit.getMacAddress(), notNullValue() );
checkParam( this.buildit.getNetworkNames().isEmpty(), is( false ) );
checkParam( this.buildit.getNetworkIds().isEmpty(), is( false ) );
checkParam( this.buildit.getNetworkIndex(), notNullValue() );
checkParam( this.buildit.getPlatform(), notNullValue() );
checkParam( this.buildit.getReservationId(), notNullValue() );
Expand Down Expand Up @@ -213,6 +221,7 @@ public static Builder builder( ) {
private String uuid;
private String macAddress = "";
private List<String> networkNames = new ArrayList<String>( );
private List<String> networkIds = new ArrayList<String>( );
private Long networkIndex = -1l;
private String privateAddress;

Expand All @@ -221,13 +230,14 @@ public static Builder builder( ) {
private VmRunType( final String reservationId, final String userData, final int amount,
final VmTypeInfo vmTypeInfo, final VmKeyInfo keyInfo, final String platform,
final List<String> instanceIds,
final int vlan, final List<String> networkNames, final List<String> networkIndexList, final List<String> uuids ) {
final int vlan, final List<String> networkNames, final List<String> networkIds, final List<String> networkIndexList, final List<String> uuids ) {
this.reservationId = reservationId;
this.userData = userData;
this.vlan = vlan;
this.vmTypeInfo = vmTypeInfo;
this.keyInfo = keyInfo;
this.networkNames = networkNames;
this.networkIds = networkIds;
this.platform = platform;
}

Expand Down Expand Up @@ -281,7 +291,11 @@ void setKeyInfo( final VmKeyInfo keyInfo ) {
void setNetworkNames( final List<String> networkNames ) {
this.networkNames = networkNames;
}


void setNetworkIds( final List<String> networkIds ) {
this.networkIds = networkIds;
}

void setInstanceId( final String instanceId ) {
this.instanceId = instanceId;
}
Expand Down Expand Up @@ -351,7 +365,11 @@ public String getInstanceId( ) {
public List<String> getNetworkNames( ) {
return this.networkNames;
}


public List<String> getNetworkIds( ) {
return this.networkIds;
}

public Long getNetworkIndex( ) {
return this.networkIndex;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,7 @@ private VmRunCallback makeRunCallback( final ResourceToken childToken, final VmT
.keyInfo( vmKeyInfo )
.launchIndex( childToken.getLaunchIndex( ) )
.networkNames( this.allocInfo.getNetworkGroups( ) )
.networkIds( this.allocInfo.getNetworkGroups( ) )
.platform( platform )
.reservationId( childToken.getAllocationInfo( ).getReservationId( ) )
.userData( this.allocInfo.getRequest( ).getUserData( ) )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class NIConfiguration {
@XmlElement(name="property") List<NIProperty> properties = Lists.newArrayList()
@XmlElement(name="property") NIMidonet midonet
@XmlElement(name="property") NISubnets subnets
@XmlElement(name="property") NIManagedSubnets managedSubnet
@XmlElement(name="property") NIClusters clusters
}

Expand Down Expand Up @@ -88,6 +89,22 @@ class NISubnet {
@XmlElement(name="property") List<NIProperty> properties = Lists.newArrayList()
}

@Canonical
@CompileStatic
@XmlAccessorType( XmlAccessType.NONE )
class NIManagedSubnets {
@XmlAttribute String name
@XmlElement(name="managedSubnet") NIManagedSubnet managedSubnet
}

@Canonical
@CompileStatic
@XmlAccessorType( XmlAccessType.NONE )
class NIManagedSubnet {
@XmlAttribute String name
@XmlElement(name="property") List<NIProperty> properties = Lists.newArrayList()
}

@Canonical
@CompileStatic
@XmlAccessorType( XmlAccessType.NONE )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
import com.eucalyptus.compute.common.network.NetworkResourceReportType;
import com.eucalyptus.compute.common.network.Networking;
import com.eucalyptus.compute.common.network.UpdateNetworkResourcesType;
import com.eucalyptus.network.EdgeNetworking;
import com.eucalyptus.network.NetworkingDriver;
import com.eucalyptus.util.Internets;
import com.eucalyptus.util.TypeMapper;
import com.eucalyptus.util.TypeMappers;
Expand Down Expand Up @@ -105,7 +105,7 @@ public NetworkStateCallback( ) {
*/
@Override
public void fire( final DescribeNetworksResponseType reply ) {
EdgeNetworking.setReported( "EDGE".equals( reply.getMode( ) ) );
NetworkingDriver.setReported( reply.getMode( ) );
UpdateNetworkResourcesType update = new UpdateNetworkResourcesType( );
update.setCluster( this.getSubject( ).getName( ) );
update.setResources( TypeMappers.transform( reply, NetworkResourceReportType.class ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public StartNetworkCallback( final ExtantNetwork extantNet ) {
extantNet.getOwnerUserId( ),
extantNet.getTag( ),
extantNet.getNetworkGroup( ).getNaturalId( ),
extantNet.getNetworkGroup().getGroupId(),
extantNet.getNetworkGroup( ).getNaturalId( ) );
msg.setUserId( this.extantNet.getOwnerUserId( ) );
msg.setAccountId( this.extantNet.getOwnerAccountNumber( ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
import com.eucalyptus.compute.common.backend.RunInstancesType;
import com.eucalyptus.compute.common.network.PublicIPResource;
import com.eucalyptus.entities.Entities;
import com.eucalyptus.network.EdgeNetworking;
import com.eucalyptus.network.NetworkingDriver;
import com.eucalyptus.records.Logs;
import com.eucalyptus.system.tracking.MessageContexts;
import com.eucalyptus.util.Callback;
Expand Down Expand Up @@ -163,7 +163,7 @@ public void fire( final VmRunResponseType reply ) {
@Override
public Boolean apply( final VmInfo input ) {
final VmInstance vm = VmInstances.lookup( input.getInstanceId( ) );
if ( !EdgeNetworking.isEnabled( ) ) {
if ( !NetworkingDriver.isEnabled( ) ) {
vm.updateAddresses( input.getNetParams( ).getIpAddress( ), input.getNetParams( ).getIgnoredPublicIp( ) );
}
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import com.eucalyptus.event.EventListener;
import com.eucalyptus.event.Listeners;
import com.eucalyptus.network.EdgeNetworking;
import com.eucalyptus.network.NetworkingDriver;
import com.eucalyptus.network.NetworkInfoBroadcaster;

/**
Expand All @@ -35,7 +35,7 @@ public static void register( ) {

@Override
public void fireEvent( final VpcInvalidationEvent event ) {
if ( EdgeNetworking.isEnabled( ) ) {
if ( NetworkingDriver.isEnabled( ) ) {
NetworkInfoBroadcaster.requestNetworkInfoBroadcast( );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,14 @@ class DispatchingNetworkingService {
LockResource.withLock( delegateLock.writeLock( ) ) {
if ( delegateNeedsUpdatingFor( networkService ) ) {
networkingServiceDelegateName = networkService
networkingServiceDelegate = poolInvoked( 'EDGE' == networkService ?
new EdgeNetworkingService( ) :
new GenericNetworkingService( ) )
if ('EDGE' == networkService) {
networkingServiceDelegate = poolInvoked(new EdgeNetworkingService())
} else if (('MANAGED' == networkService) || ('MANAGED-NOVLAN' == networkService)) {
networkingServiceDelegate = poolInvoked(new ManagedNetworkingService())
} else {
// TODO: Need to figure out why we hit this case...
networkingServiceDelegate = poolInvoked(new ManagedNetworkingService())
}
}
void
}
Expand Down

This file was deleted.

Loading

0 comments on commit ee1b9a4

Please sign in to comment.