Permalink
Browse files

latest merge from eee

  • Loading branch information...
2 parents e4f6457 + 01bf107 commit 070d38bd51bcbddfaa2f23826a37ccf86eda1e42 Daniel Nurmi committed Dec 1, 2011
Showing with 2,550 additions and 1,243 deletions.
  1. +2 −2 clc/.classpath
  2. +41 −20 clc/modules/cloud/src/main/java/com/eucalyptus/cloud/EucalyptusBuilder.java
  3. +3 −3 clc/modules/cluster-manager/src/main/java/com/eucalyptus/blockstorage/SnapshotManager.java
  4. +2 −1 clc/modules/cluster-manager/src/main/java/com/eucalyptus/blockstorage/Snapshots.java
  5. +2 −1 clc/modules/cluster-manager/src/main/java/com/eucalyptus/blockstorage/StorageUtil.java
  6. +16 −11 clc/modules/cluster-manager/src/main/java/com/eucalyptus/blockstorage/VolumeManager.java
  7. +2 −2 clc/modules/cluster-manager/src/main/java/com/eucalyptus/blockstorage/Volumes.java
  8. +3 −3 clc/modules/cluster-manager/src/main/java/com/eucalyptus/cloud/ResourceToken.java
  9. +3 −2 clc/modules/cluster-manager/src/main/java/com/eucalyptus/cloud/run/AdmissionControl.java
  10. +26 −7 clc/modules/cluster-manager/src/main/java/com/eucalyptus/cloud/run/ClusterAllocator.java
  11. +2 −2 clc/modules/cluster-manager/src/main/java/com/eucalyptus/cloud/run/VerifyMetadata.java
  12. +14 −14 clc/modules/cluster-manager/src/main/java/com/eucalyptus/cluster/Cluster.java
  13. +0 −4 clc/modules/cluster-manager/src/main/java/com/eucalyptus/cluster/Clusters.java
  14. +5 −2 clc/modules/cluster-manager/src/main/java/com/eucalyptus/cluster/callback/VolumeAttachCallback.java
  15. +10 −5 clc/modules/cluster-manager/src/main/java/com/eucalyptus/images/ImageManager.java
  16. +46 −37 clc/modules/cluster-manager/src/main/java/com/eucalyptus/network/NetworkGroupManager.java
  17. +6 −2 clc/modules/cluster-manager/src/main/java/com/eucalyptus/util/async/StatefulMessageSet.java
  18. +12 −6 clc/modules/cluster-manager/src/main/java/com/eucalyptus/vm/VmControl.java
  19. +4 −2 clc/modules/cluster-manager/src/main/java/com/eucalyptus/vm/VmInstances.java
  20. +3 −3 clc/modules/cluster-manager/src/main/java/com/eucalyptus/vm/VmTypes.java
  21. +16 −9 clc/modules/configuration/src/main/java/com/eucalyptus/config/Configuration.java
  22. +41 −49 clc/modules/dns/src/main/java/com/eucalyptus/bootstrap/DNSBootstrapper.java
  23. +21 −4 clc/modules/dns/src/main/java/com/eucalyptus/cloud/ws/DNSControl.java
  24. +92 −92 clc/modules/dns/src/main/java/com/eucalyptus/cloud/ws/TCPHandler.java
  25. +70 −59 clc/modules/dns/src/main/java/com/eucalyptus/cloud/ws/TCPListener.java
  26. +7 −0 clc/modules/dns/src/main/java/com/eucalyptus/cloud/ws/UDPListener.java
  27. +6 −2 clc/modules/msgs/conf/scripts/setup_dbpool.groovy
  28. +4 −0 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/Bootstrap.java
  29. +749 −48 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/Databases.java
  30. +7 −10 clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/Hosts.java
  31. +0 −3 clc/modules/msgs/src/main/java/com/eucalyptus/component/BasicService.java
  32. +35 −31 clc/modules/msgs/src/main/java/com/eucalyptus/component/Faults.java
  33. +0 −19 clc/modules/msgs/src/main/java/com/eucalyptus/component/Partitions.java
  34. +1 −3 clc/modules/msgs/src/main/java/com/eucalyptus/component/ServiceBuilder.java
  35. +0 −160 clc/modules/msgs/src/main/java/com/eucalyptus/component/ServiceCheckRecord.java
  36. +0 −267 clc/modules/msgs/src/main/java/com/eucalyptus/component/ServiceChecks.java
  37. +1 −1 clc/modules/msgs/src/main/java/com/eucalyptus/component/ServiceState.java
  38. +41 −29 clc/modules/msgs/src/main/java/com/eucalyptus/component/ServiceTransitions.java
  39. +12 −4 clc/modules/msgs/src/main/java/com/eucalyptus/component/Topology.java
  40. +0 −3 clc/modules/msgs/src/main/java/com/eucalyptus/config/ComponentConfiguration.java
  41. +1 −1 clc/modules/msgs/src/main/java/com/eucalyptus/configurable/PropertyDirectory.java
  42. +1 −1 clc/modules/msgs/src/main/java/com/eucalyptus/context/ServiceContextManager.java
  43. +16 −0 clc/modules/msgs/src/main/java/com/eucalyptus/entities/Entities.java
  44. +1 −0 clc/modules/msgs/src/main/java/com/eucalyptus/entities/EntityWrapper.java
  45. +7 −1 clc/modules/msgs/src/main/java/com/eucalyptus/entities/PersistenceContexts.java
  46. +2 −2 clc/modules/msgs/src/main/java/com/eucalyptus/event/SystemClock.java
  47. +56 −6 clc/modules/msgs/src/main/java/com/eucalyptus/system/Threads.java
  48. +14 −11 clc/modules/msgs/src/main/java/com/eucalyptus/util/RestrictedTypes.java
  49. +23 −6 clc/modules/msgs/src/main/java/com/eucalyptus/util/async/AsyncRequest.java
  50. +17 −13 clc/modules/msgs/src/main/java/com/eucalyptus/util/fsm/AtomicMarkedState.java
  51. +5 −4 clc/modules/msgs/src/main/java/com/eucalyptus/ws/EmpyreanService.java
  52. +1 −1 clc/modules/msgs/src/main/java/com/eucalyptus/ws/WebServices.java
  53. +2 −2 clc/modules/msgs/src/main/java/edu/ucsb/eucalyptus/msgs/Messages.groovy
  54. +1 −1 clc/modules/reporting/src/main/java/com/eucalyptus/reporting/ReportGenerator.java
  55. +1 −1 ...ules/reporting/src/main/java/com/eucalyptus/reporting/modules/instance/InstanceEventListener.java
  56. +1 −0 clc/modules/reporting/src/main/java/com/eucalyptus/reporting/modules/instance/InstanceUsageLog.java
  57. +32 −2 clc/modules/reporting/src/main/java/com/eucalyptus/reporting/units/Units.java
  58. +151 −45 clc/modules/reporting/src/test/pl/check_db.pl
  59. +143 −0 clc/modules/reporting/src/test/pl/check_report.pl
  60. +29 −35 clc/modules/reporting/src/test/pl/simulate_one_user.pl
  61. +77 −45 clc/modules/reporting/src/test/pl/simulate_usage.pl
  62. +315 −0 clc/modules/reporting/src/test/pl/test_reporting.pl
  63. +0 −10 clc/modules/walrus/src/main/java/edu/ucsb/eucalyptus/cloud/ws/WalrusManager.java
  64. +50 −8 clc/modules/www/src/main/java/com/eucalyptus/www/Redirect.java
  65. +1 −2 clc/modules/www/src/main/java/com/eucalyptus/www/ReportServlet.java
  66. +30 −0 devel/diffdbs.sh
  67. +7 −21 devel/failover.sh
  68. +20 −0 devel/grabdbs.sh
  69. +4 −5 node/handlers.c
  70. +1 −0 node/handlers.h
  71. +17 −2 node/handlers_default.c
  72. +18 −4 node/handlers_kvm.c
  73. +6 −6 node/handlers_xen.c
  74. +119 −54 node/xml.c
  75. +2 −2 node/xml.h
  76. +5 −1 storage/backing.c
  77. +1 −5 storage/blobstore.c
  78. +1 −1 storage/imager.c
  79. +19 −15 storage/vbr.c
  80. +1 −0 storage/vbr.h
  81. +39 −4 tools/libvirt.xsl
  82. +8 −4 util/eucalyptus.h
View
@@ -158,7 +158,7 @@
<classpathentry kind="lib" path="lib/kahadb-5.4.1.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.15.jar"/>
<classpathentry kind="lib" path="lib/manageontap.jar"/>
- <classpathentry kind="lib" path="lib/mule-core-2.0.1.jar"/>
+ <classpathentry kind="lib" path="lib/mule-core-2.0.1.jar" sourcepath="/bzr/third-party/mule-2.0.1.orig"/>
<classpathentry kind="lib" path="lib/mule-module-builders-2.0.1.jar"/>
<classpathentry kind="lib" path="lib/mule-module-client-2.0.1.jar"/>
<classpathentry kind="lib" path="lib/mule-module-management-2.0.1.jar"/>
@@ -171,7 +171,7 @@
<classpathentry kind="lib" path="lib/org.restlet-1.1.5.jar"/>
<classpathentry kind="lib" path="lib/org.restlet.ext.velocity-1.1.5.jar"/>
<classpathentry kind="lib" path="lib/org.simpleframework-3.1.3.jar"/>
- <classpathentry kind="lib" path="lib/proxool-0.9.1.jar"/>
+ <classpathentry kind="lib" path="lib/proxool-0.9.1.jar" sourcepath="/bzr/third-party/proxool-0.9.1"/>
<classpathentry kind="lib" path="lib/proxool-cglib.jar"/>
<classpathentry kind="lib" path="lib/quartz-1.6.5.jar"/>
<classpathentry kind="lib" path="lib/regexp-1.4.jar"/>
@@ -3,6 +3,7 @@
import java.net.InetAddress;
import java.net.UnknownHostException;
import org.apache.log4j.Logger;
+import com.eucalyptus.bootstrap.Databases;
import com.eucalyptus.bootstrap.Handles;
import com.eucalyptus.bootstrap.Host;
import com.eucalyptus.bootstrap.Hosts;
@@ -18,6 +19,7 @@
import com.eucalyptus.records.EventType;
import com.eucalyptus.util.Exceptions;
import com.eucalyptus.util.Internets;
+import com.google.common.base.Predicate;
@ComponentPart( Eucalyptus.class )
@Handles( { RegisterEucalyptusType.class,
@@ -83,27 +85,46 @@ public void fireCheck( ServiceConfiguration config ) throws ServiceRegistrationE
Host coordinator = Hosts.getCoordinator( );
if ( coordinator == null ) {
throw Faults.failure( config, Exceptions.error( config.getFullName( ) + ":fireCheck(): failed to lookup coordinator (" + coordinator + ")." ) );
- } else if ( coordinator.isLocalHost( ) && !Topology.isEnabledLocally( Eucalyptus.class ) && !config.isVmLocal( ) ) {
- throw Faults.failure( config,
- Exceptions.error( config.getFullName( )
- + ":fireCheck(): cloud controller depends upon ENABLED coordinator service for: "
- + coordinator ) );
- } else if ( !coordinator.isLocalHost( ) && config.isVmLocal( ) ) {
- if ( !Topology.isEnabled( Eucalyptus.class ) ) {
- throw Faults.failure( config,
- Exceptions.error( config.getFullName( )
- + ":fireCheck(): local cloud controller service isn't coordinator and is missing ENABLED cloud controller service: "
- + coordinator ) );
- } else if ( Topology.lookup( Eucalyptus.class ).isVmLocal( ) ) {
- throw Faults.failure( config,
- Exceptions.error( config.getFullName( )
- + ":fireCheck(): local cloud controller service cant be enabled when it is not the coordinator: "
- + coordinator ) );
- } else {
- LOG.debug( config.getFullName( ) + ":fireCheck() completed with coordinator currently: " + coordinator );
- }
-
+ } else if ( coordinator.isLocalHost( ) ) {
+ Check.COORDINATOR.apply( config );
+ } else if ( !coordinator.isLocalHost( ) ) {
+ Check.SECONDARY.apply( config );
}
}
+ enum Check implements Predicate<ServiceConfiguration> {
+ COORDINATOR {
+
+ @Override
+ public boolean apply( ServiceConfiguration config ) {
+//GRZE: No service check makes sense here.
+ return true;
+ }
+ },
+ SECONDARY {
+
+ @Override
+ public boolean apply( ServiceConfiguration config ) {
+ if ( config.isVmLocal( ) ) {
+ if ( !Databases.isSynchronized( ) ) {
+ throw Faults.failure( config,
+ Exceptions.error( config.getFullName( )
+ + ":fireCheck(): eucalyptus service " + config.getFullName( ) + " is currently synchronizing: "
+ + Hosts.getCoordinator( ) ) );
+ } else if ( Topology.isEnabledLocally( Eucalyptus.class ) ) {
+ throw Faults.failure( config,
+ Exceptions.error( config.getFullName( )
+ + ":fireCheck(): eucalyptus service " + config.getFullName( ) + " cant be enabled when it is not the coordinator: "
+ + Hosts.getCoordinator( ) ) );
+ } else {
+ LOG.debug( config.getFullName( ) + ":fireCheck() completed with coordinator currently: " + Hosts.getCoordinator( ) );
+ }
+ }
+ return true;
+ }
+ };
+
+ @Override
+ public abstract boolean apply( ServiceConfiguration input );
+ }
}
@@ -121,7 +121,7 @@ public CreateSnapshotResponseType create( CreateSnapshotType request ) throws Eu
final Context ctx = Contexts.lookup( );
EntityWrapper<Snapshot> db = EntityWrapper.get( Snapshot.class );
Volume vol = Transactions.find( Volume.named( ctx.getUserFullName( ).asAccountFullName( ), request.getVolumeId( ) ) );
- final ServiceConfiguration sc = Partitions.lookupService( Storage.class, vol.getPartition( ) );
+ final ServiceConfiguration sc = Topology.lookup( Storage.class, Partitions.lookupByName( vol.getPartition( ) ) );
final Volume volReady = Volumes.checkVolumeReady( vol );
Supplier<Snapshot> allocator = new Supplier<Snapshot>( ) {
@@ -169,7 +169,7 @@ public boolean apply( Snapshot snap ) {
throw Exceptions.toUndeclared( "Not authorized to delete snapshot " + request.getSnapshotId( ) + " by " + ctx.getUser( ).getName( ),
new EucalyptusCloudException( ) );
} else {
- ServiceConfiguration sc = Partitions.lookupService( Storage.class, snap.getVolumePartition( ) );
+ ServiceConfiguration sc = Topology.lookup( Storage.class, Partitions.lookupByName( snap.getPartition( ) ) );
try {
DeleteStorageSnapshotResponseType scReply = ServiceDispatcher.lookup( sc ).send( new DeleteStorageSnapshotType( snap.getDisplayName( ) ) );
if ( scReply.get_return( ) ) {
@@ -218,7 +218,7 @@ public DescribeSnapshotsResponseType describe( DescribeSnapshotsType request ) t
DescribeStorageSnapshotsType scRequest = new DescribeStorageSnapshotsType( Lists.newArrayList( snap.getDisplayName( ) ) );
if ( request.getSnapshotSet( ).isEmpty( ) || request.getSnapshotSet( ).contains( snap.getDisplayName( ) ) ) {
try {
- ServiceConfiguration sc = Partitions.lookupService( Storage.class, snap.getPartition( ) );
+ ServiceConfiguration sc = Topology.lookup( Storage.class, Partitions.lookupByName( snap.getPartition( ) ) );
DescribeStorageSnapshotsResponseType snapshotInfo = ServiceDispatcher.lookup( sc ).send( scRequest );
for ( StorageSnapshot storageSnapshot : snapshotInfo.getSnapshotSet( ) ) {
snap.setMappedState( storageSnapshot.getStatus( ) );
@@ -72,6 +72,7 @@
import com.eucalyptus.cloud.util.DuplicateMetadataException;
import com.eucalyptus.component.Partitions;
import com.eucalyptus.component.ServiceConfiguration;
+import com.eucalyptus.component.Topology;
import com.eucalyptus.component.id.Storage;
import com.eucalyptus.crypto.Crypto;
import com.eucalyptus.entities.EntityWrapper;
@@ -130,7 +131,7 @@ static Snapshot initializeSnapshot( UserFullName userFullName, Volume vol, Servi
}
static Snapshot startCreateSnapshot( final Volume vol, final Snapshot snap ) throws EucalyptusCloudException, DuplicateMetadataException {
- final ServiceConfiguration sc = Partitions.lookupService( Storage.class, vol.getPartition( ) );
+ final ServiceConfiguration sc = Topology.lookup( Storage.class, Partitions.lookupByName( vol.getPartition( ) ) );
try {
Snapshot snapState = Transactions.save( snap, new Callback<Snapshot>( ) {
@@ -78,6 +78,7 @@
import com.eucalyptus.component.NoSuchServiceException;
import com.eucalyptus.component.Partitions;
import com.eucalyptus.component.ServiceConfiguration;
+import com.eucalyptus.component.Topology;
import com.eucalyptus.component.id.Storage;
import com.eucalyptus.entities.EntityWrapper;
import com.eucalyptus.util.EucalyptusCloudException;
@@ -106,7 +107,7 @@
ArrayList<edu.ucsb.eucalyptus.msgs.Volume> reply = Lists.newArrayList( );
for( String partition : partitionVolumeMap.keySet( ) ) {
try {
- ServiceConfiguration scConfig = Partitions.lookupService( Storage.class, partition );
+ ServiceConfiguration scConfig = Topology.lookup( Storage.class, Partitions.lookupByName( partition ) );
Iterator<String> volumeNames = Iterators.transform( partitionVolumeMap.get( partition ).iterator( ), new Function<Volume,String>() {
@Override
public String apply( Volume arg0 ) {
@@ -77,6 +77,7 @@
import com.eucalyptus.cluster.Clusters;
import com.eucalyptus.cluster.callback.VolumeAttachCallback;
import com.eucalyptus.cluster.callback.VolumeDetachCallback;
+import com.eucalyptus.component.Partition;
import com.eucalyptus.component.Partitions;
import com.eucalyptus.component.ServiceConfiguration;
import com.eucalyptus.component.Topology;
@@ -205,7 +206,7 @@ public DeleteVolumeResponseType DeleteVolume( DeleteVolumeType request ) throws
db.commit( );
return reply;
}
- ServiceConfiguration sc = Partitions.lookupService( Storage.class, vol.getPartition( ) );
+ ServiceConfiguration sc = Topology.lookup( Storage.class, Partitions.lookupByName( vol.getPartition( ) ) );
DeleteStorageVolumeResponseType scReply = ServiceDispatcher.lookup( sc ).send( new DeleteStorageVolumeType( vol.getDisplayName( ) ) );
if ( scReply.get_return( ) ) {
vol.setState( State.ANNIHILATING );
@@ -300,10 +301,11 @@ public AttachVolumeResponseType AttachVolume( AttachVolumeType request ) throws
}
Cluster cluster = null;
try {
- cluster = Clusters.lookup( vm.lookupPartition( ) );
+ ServiceConfiguration ccConfig = Topology.lookup( ClusterController.class, vm.lookupPartition( ) );
+ cluster = Clusters.lookup( ccConfig );
} catch ( NoSuchElementException e ) {
LOG.debug( e, e );
- throw new EucalyptusCloudException( "Cluster does not exist: " + Topology.lookup( ClusterController.class, vm.lookupPartition( ) ) );
+ throw new EucalyptusCloudException( "Cluster does not exist in partition: " + vm.getPartition( ) );
}
final String deviceName = request.getDevice( );
final String volumeId = request.getVolumeId( );
@@ -338,8 +340,9 @@ public AttachVolumeResponseType AttachVolume( AttachVolumeType request ) throws
if ( !RestrictedTypes.filterPrivileged( ).apply( volume ) ) {
throw new EucalyptusCloudException( "Not authorized to attach volume " + request.getVolumeId( ) + " by " + ctx.getUser( ).getName( ) );
}
- ServiceConfiguration sc = Partitions.lookupService( Storage.class, volume.getPartition( ) );
- ServiceConfiguration scVm = Partitions.lookupService( Storage.class, cluster.getConfiguration( ).getPartition( ) );
+ Partition volPartition = Partitions.lookupByName( volume.getPartition( ) );
+ ServiceConfiguration sc = Topology.lookup( Storage.class, volPartition );
+ ServiceConfiguration scVm = Topology.lookup( Storage.class, cluster.getConfiguration( ).lookupPartition( ) );
if ( !sc.equals( scVm ) ) {
throw new EucalyptusCloudException( "Can only attach volumes in the same cluster: " + request.getVolumeId( ) );
} else if ( "invalid".equals( volume.getRemoteDevice( ) ) ) {
@@ -364,7 +367,7 @@ public AttachVolumeResponseType AttachVolume( AttachVolumeType request ) throws
EventRecord.here( VolumeManager.class, EventClass.VOLUME, EventType.VOLUME_ATTACH )
.withDetails( volume.getOwner( ).toString( ), volume.getDisplayName( ), "instance", vm.getInstanceId( ) )
- .withDetails( "partition", vm.lookupPartition( ).toString( ) ).info( );
+ .withDetails( "partition", vm.getPartition( ).toString( ) ).info( );
reply.setAttachedVolume( attachVol );
return reply;
}
@@ -411,15 +414,17 @@ public DetachVolumeResponseType detach( DetachVolumeType request ) throws Eucaly
}
Cluster cluster = null;
+ ServiceConfiguration ccConfig = null;
try {
- cluster = Clusters.getInstance( ).lookup( vm.lookupPartition( ) );
+ ccConfig = Topology.lookup( ClusterController.class, vm.lookupPartition( ) );
+ cluster = Clusters.lookup( ccConfig );
} catch ( NoSuchElementException e ) {
LOG.debug( e, e );
- throw new EucalyptusCloudException( "Cluster does not exist: " + Topology.lookup( ClusterController.class, vm.lookupPartition( ) ) );
+ throw new EucalyptusCloudException( "Cluster does not exist in partition: " + vm.getPartition( ) );
}
ServiceConfiguration scVm;
try {
- scVm = Partitions.lookupService( Storage.class, cluster.getConfiguration( ).getPartition( ) );
+ scVm = Topology.lookup( Storage.class, vm.lookupPartition( ) );
} catch ( Exception ex ) {
LOG.error( ex, ex );
throw new EucalyptusCloudException( "Failed to lookup SC for cluster: " + cluster, ex );
@@ -436,8 +441,8 @@ public DetachVolumeResponseType detach( DetachVolumeType request ) throws Eucaly
request.setInstanceId( vm.getInstanceId( ) );
AsyncRequests.newRequest( new VolumeDetachCallback( request ) ).dispatch( cluster.getConfiguration( ) );
EventRecord.here( VolumeManager.class, EventClass.VOLUME, EventType.VOLUME_DETACH )
- .withDetails( vm.getOwner( ).toString( ), volume.getVolumeId( ), "instance", vm.getInstanceId( ) ).withDetails( "cluster",
- Topology.lookup( ClusterController.class, vm.lookupPartition( ) ).toString( ) ).info( );
+ .withDetails( vm.getOwner( ).toString( ), volume.getVolumeId( ), "instance", vm.getInstanceId( ) )
+ .withDetails( "cluster", ccConfig.getFullName( ).toString( ) ).info( );
volume.setStatus( "detaching" );
reply.setDetachedVolume( volume );
return reply;
@@ -63,7 +63,6 @@
package com.eucalyptus.blockstorage;
-import java.lang.reflect.UndeclaredThrowableException;
import java.util.List;
import java.util.concurrent.ExecutionException;
import org.apache.log4j.Logger;
@@ -72,6 +71,7 @@
import com.eucalyptus.cloud.CloudMetadata.VolumeMetadata;
import com.eucalyptus.component.Partitions;
import com.eucalyptus.component.ServiceConfiguration;
+import com.eucalyptus.component.Topology;
import com.eucalyptus.component.id.Storage;
import com.eucalyptus.crypto.Crypto;
import com.eucalyptus.entities.EntityWrapper;
@@ -135,7 +135,7 @@ public static Volume checkVolumeReady( final Volume vol ) throws EucalyptusCloud
return vol;
} else {
//TODO:GRZE:REMOVE temporary workaround to update the volume state.
- final ServiceConfiguration sc = Partitions.lookupService( Storage.class, vol.getPartition( ) );
+ final ServiceConfiguration sc = Topology.lookup( Storage.class, Partitions.lookupByName( vol.getPartition( ) ) );
final DescribeStorageVolumesType descVols = new DescribeStorageVolumesType( Lists.newArrayList( vol.getDisplayName( ) ) );
try {
Transactions.one( Volume.named( null, vol.getDisplayName( ) ), new Callback<Volume>( ) {
@@ -244,15 +244,15 @@ Integer getResourceAllocationSequenceNumber( ) {
}
public void submit( ) throws NoSuchTokenException {
- Clusters.lookup( this.getAllocationInfo( ).getPartition( ) ).getNodeState( ).submitToken( this );
+ Clusters.lookup( Topology.lookup( ClusterController.class, this.getAllocationInfo( ).getPartition( ) ) ).getNodeState( ).submitToken( this );
}
public void redeem( ) throws NoSuchTokenException {
- Clusters.lookup( this.getAllocationInfo( ).getPartition( ) ).getNodeState( ).redeemToken( this );
+ Clusters.lookup( Topology.lookup( ClusterController.class, this.getAllocationInfo( ).getPartition( ) ) ).getNodeState( ).redeemToken( this );
}
public void release( ) throws NoSuchTokenException {
- Clusters.lookup( this.getAllocationInfo( ).getPartition( ) ).getNodeState( ).releaseToken( this );
+ Clusters.lookup( Topology.lookup( ClusterController.class, this.getAllocationInfo( ).getPartition( ) ) ).getNodeState( ).releaseToken( this );
}
public void setNetworkIndex( PrivateNetworkIndex networkIndex ) {
@@ -259,7 +259,7 @@ public String apply( Cluster arg0 ) {
try {
ServiceConfiguration sc = Topology.lookup( Storage.class, partition );
} catch ( Exception ex ) {
- throw new NotEnoughResourcesException( "Not enough resources: " + ex.getMessage( ), ex );
+ throw new NotEnoughResourcesException( "Not enough resources: Cannot run EBS instances in partition w/o a storage controller: " + ex.getMessage( ), ex );
}
}
try {
@@ -307,7 +307,8 @@ private int checkAvailability( String vmTypeName, List<Cluster> authorizedCluste
return Lists.newArrayList( sorted.values( ) );
}
} else {
- Cluster cluster = Clusters.getInstance( ).lookup( Partitions.lookupService( ClusterController.class, partitionName ) );
+ ServiceConfiguration ccConfig = Topology.lookup( ClusterController.class, Partitions.lookupByName( partitionName ) );
+ Cluster cluster = Clusters.lookup( ccConfig );
if ( cluster == null ) {
throw new NotEnoughResourcesException( "Can't find cluster " + partitionName );
}
Oops, something went wrong.

0 comments on commit 070d38b

Please sign in to comment.