Bug 751793

Summary: Document how to submit an EC2 job in a different availability zone
Product: Red Hat Enterprise MRG Reporter: Luigi Toscano <ltoscano>
Component: Grid_User_GuideAssignee: Alison Young <alyoung>
Status: CLOSED CURRENTRELEASE QA Contact: Jeff Needle <jneedle>
Severity: high Docs Contact:
Priority: high    
Version: 2.1CC: jneedle, lbrindle, matt, tstclair
Target Milestone: 2.1   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-26 19:20:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Luigi Toscano 2011-11-07 15:22:02 UTC
Description of problem:
When a specific availability zone is requested, the job is not run and the following error is returned:

Hold reason: <?xml version="1.0" encoding="UTF-8"?>\n<Response><Errors><Error><Code>InvalidAMIID.NotFound</Code><Message>The AMI ID 'ami-xyzt' does not exist</Message></Error></Errors><RequestID>c651824a-f706-40a3-a61e-b38fb11c5b32</RequestID></Response>



Version-Release number of selected component (if applicable):
condor-7.6.5-0.5

How reproducible:
Submit the following jobs: (ami-xyzt must be a valid AMI id in the ap-northeast-1, make sure that ap-northeast-1 is not your default zone):
---------------------------------
Universe = grid
grid_resource=ec2 https://ec2.amazonaws.com
Executable=ec2
transfer_executable=false
# The credentials
ec2_access_key_id=/var/lib/amazon/accesskey.txt
ec2_secret_access_key=/var/lib/amazon/secretkey.txt
# The AMI ID
ec2_ami_id=ami-xyzt
ec2_instance_type=m1.small
ec2_user_data='Hello EC2!'
# The keypair file (ssh)
ec2_keypair_file=/tmp/keyfile_small_1320405677_490334505__
ec2_availability_zone=ap-northeast-1c

queue 
---------------------------------

The job will be moved to held with the error reported above.

From the logs the parameter ( Placement.AvailabilityZone ) documented in Amazon API seems to be correctly passed.

Comment 2 Luigi Toscano 2011-11-07 17:47:31 UTC
This is more a documentation issue. 
When an AMI from a different region/provider is requested, the service URL must be changed. For the example in bug description, grid_manager must be
grid_resource=ec2 https://ec2.ap-northeast-1.amazonaws.com

ec2_availability_zone requires the AMI to be run in specific availability zone *which belongs to the region/provider where the region is*. This parameter is not mandatory.

We should document somehow this in order to allow users to easily run AMIs in other zones.
The list of currently available regions can be found here (section "Amazon Elastic Compute Cloud"):
http://docs.amazonwebservices.com/general/latest/gr/index.html?rande.html

Reassigning to documentation.

The issue affects also EC2/Enhanced, but it requires also some code changes that need to be tracked in another bug.

Comment 3 Timothy St. Clair 2011-11-08 18:19:20 UTC
Under 17.2 update the example to include the following

grid_resource = ec2 https://ec2.amazonaws.com/
+ # To submit to a different region update the url passed to the grid_resource
+ # e.g. https://ec2.ap-northeast-1.amazonaws.com
+ # Note: The ami *must* be present in that region

ec2_availability_zone = us-east-1b
+ # Note: zone must be within specified or default region

Comment 5 Lana Brindley 2012-01-26 19:20:03 UTC
This book is now available on redhat.com/docs. Please raise a new bug if you spot any issues.

Thanks,
LKB