Bug 36147 - Multiple EC2 connections
Multiple EC2 connections
Product: UCS
Classification: Unclassified
Component: Virtualization - UVMM
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.0
Assigned To: Erik Damrose
Stefan Gohmann
: interim-3
Depends on:
  Show dependency treegraph
Reported: 2014-10-11 09:07 CEST by Stefan Gohmann
Modified: 2014-11-26 06:53 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted after Product Owner Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2014-10-11 09:07:48 CEST
I've created two EC2 connections for different regions:

 {'available': True,
  'cloudtype': 'EC2',
  'last_update': 1413011175.001877,
  'last_update_try': 1413011175.001877,
  'name': 'Amazon Ireland',
  'url': 'EC2_EU_WEST'},
 {'available': True,
  'cloudtype': 'EC2',
  'last_update': 1413011164.817835,
  'last_update_try': 1413011164.817835,
  'name': 'Amazon South America',
  'url': 'EC2_SA_EAST'}

But I get only the instances from SA_EAST.
Comment 1 Stefan Gohmann univentionstaff 2014-10-11 09:12:40 CEST
During the creation of the second EC2 instance I first got the following traceback in the log file. In UVMM it was a message that the name is invalid:

2014-10-11 09:03:30,077 - uvmmd.unix - ERROR - [27] Exception: Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/univention/uvmm/unix.py", line 149, in handle_command
    res = cmd(self, command)
  File "/usr/lib/pymodules/python2.7/univention/uvmm/commands.py", line 65, in L_CLOUD_ADD
  File "/usr/lib/pymodules/python2.7/univention/uvmm/cloudnode.py", line 120, in add_connection
    self[cloud["name"]] = create_cloud_connection(cloud, self.cache_dir)
  File "/usr/lib/pymodules/python2.7/univention/uvmm/cloudnode.py", line 215, in create_cloud_connection
    return EC2CloudConnection(cloud, cache_dir)
  File "/usr/lib/pymodules/python2.7/univention/uvmm/ec2cloud.py", line 114, in __init__
    super(EC2CloudConnection, self).__init__(cloud, cache_dir)
  File "/usr/lib/pymodules/python2.7/univention/uvmm/cloudconnection.py", line 85, in __init__
  File "/usr/lib/pymodules/python2.7/univention/uvmm/cloudconnection.py", line 181, in cache_restore
    if os.path.isfile(cache_file_name):
  File "/usr/lib/python2.7/genericpath.py", line 29, in isfile
    st = os.stat(path)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe3' in position 63: ordinal not in range(128)

I changed the name in UVMM but the connection was created too. After removing the "São Paulo" connection, everything worked as expected.
Comment 2 Stefan Gohmann univentionstaff 2014-10-11 09:14:13 CEST
Strange, after some time I again get only the instance from one EC2 connection regardless which cloud I select.
Comment 3 Andreas Peichert univentionstaff 2014-10-23 17:43:20 CEST
tested separately by changing the region in ldap and restart uvmmd:

EC2_EU_WEST 'EU (Ireland)' - 79 instances
EC2_US_EAST 'US East (N. Virginia)' - Error: Invalid region: EC2_US_EAST
EC2_US_WEST 'West (N. California)' - 0 instances
EC2_US_WEST_OREGON 'US West (Oregon)' - 0 instances
EC2_AP_SOUTHEAST 'Asia Pacific (Sydney)' - 0 instances
EC2_AP_NORTHEAST 'Asia Pacific (Tokyo)' - 0 instances
EC2_AP_SOUTHEAST2 'Asia Pacific (Singapore)' - 0 instances
EC2_SA_EAST 'South America (São Paulo)' - 0 instances

adding EC2_EU_WEST and EC2_SA_EAST at the same time, then both are empty (0 instances).
Comment 4 Erik Damrose univentionstaff 2014-10-29 11:16:59 CET
libcloud used a global class definition for the ec2 connection endpoint, which prevented connections to more than one endpoint. Fixed with

r13931 +  13932 50_fix_ec2_us_east_multiple_connections_and_instance_states.patch
libcloud 0.15.1-1.7.201410291105
Comment 5 Andreas Peichert univentionstaff 2014-10-30 13:22:50 CET
Verified: (In reply to Erik Damrose from comment #4)
> r13931 +  13932
> 50_fix_ec2_us_east_multiple_connections_and_instance_states.patch
> libcloud 0.15.1-1.7.201410291105

Verified: region EC2_US_EAST is working
Verified: uvmm/libcloud works now with more than one region
Comment 6 Stefan Gohmann univentionstaff 2014-10-31 09:51:15 CET
(In reply to Andreas Peichert from comment #5)
> Verified: region EC2_US_EAST is working
> Verified: uvmm/libcloud works now with more than one region

Comment 7 Stefan Gohmann univentionstaff 2014-11-26 06:53:57 CET
UCS 4.0-0 has been released:

If this error occurs again, please use "Clone This Bug".