cloudstack-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prachi Damle <Prachi.Da...@citrix.com>
Subject RE: Cloudbridge SetOfferMapping [SOLVED]
Date Wed, 18 Jul 2012 20:19:03 GMT
>>Is there a bug filed for this ?

Doesn't look like.  Please file it for standalone cloudbridge component since 

This bug is not applicable 3.0.3 onwards as the offering table is not present in the CS-integrated
version of EC2.

-Prachi
-----Original Message-----
From: sebastien goasguen [mailto:runseb@gmail.com] 
Sent: Wednesday, July 18, 2012 12:56 PM
To: cloudstack-users@incubator.apache.org
Subject: Re: Cloudbridge SetOfferMapping [SOLVED]

On Wed, Jul 18, 2012 at 3:50 PM, sebastien goasguen <runseb@gmail.com> wrote:
> On Wed, Jul 18, 2012 at 2:00 PM, Chiradeep Vittal 
> <Chiradeep.Vittal@citrix.com> wrote:
>> It also looks like you need to escape the ampersand or surround with 
>> quotes. -- your shell created 2 background jobs.
>>
>> On 7/18/12 10:52 AM, "Prachi Damle" <Prachi.Damle@citrix.com> wrote:
>>
>>>Hi Sebastien.
>>>
>>>Seems docs need to be corrected. Looking at the authentication code, 
>>>I see that the REST query also needs:
>>>1. AWSAccessKeyId (CS API key of the user) 2. Signature 3. 
>>>SignatureMethod ("HmacSHA256" or "HmacSHA1") 4. Version (wsdlVersion 
>>>mentioned I the ec2-service.properties of your
>>>installation)
>>>5. SignatureVersion (=2)
>>>6. Timestamp (date and time at which the request is SIGNED)
>>>
>>>
>>>
>>>But from the output of the cloud-setup-bridge cmd that you have 
>>>pasted, your service offering looks already mapped:
>>>
>>>>>>Service offering ID for m1.small
>>>>>>[ef2537ad-c70f-11e1-821b-0800277e749c]:
>>>>>>Service offering ID for m1.large [2]:
>>>
>>>The value enclosed within [] is the offering ID mapping existing in 
>>>the DB.
>>>If you run cloud-setup-bridge again and enter a new ID, the existing 
>>>mapping will be overwritten.
>>>
>>>You can check following table in your DB to see if the mapping is set:
>>>SELECT * FROM offering_bundle;
>>>
>>>
>>>Also, If you happen to use CS 3.0.3 later, EC2 is installed along 
>>>with CS and you can create EC2 offerings through CS UI.
>>>
>>>Thanks,
>>>Prachi
>>>
>>>-----Original Message-----
>>>From: sebastien goasguen [mailto:runseb@gmail.com]
>>>Sent: Wednesday, July 18, 2012 10:18 AM
>>>To: cloudstack-users@incubator.apache.org
>>>Subject: Cloudbridge SetOfferMapping
>>>
>>>HI,
>>>
>>>I am trying to register a service offering in cloudbridge (CS 3.0.2, 
>>>cloudbridge 1.1.2), to map m1.small instance type to a service 
>>>offering id.
>>>According to
>>>http://docs.cloud.com/CloudBridge_Documentation/Utility_Commands_for_
>>>Cloud
>>>Bridge
>>>
>>>I did:
>>>
>>>curl
>>>http://192.168.56.103:8090/bridge/rest/AmazonEC2?Action=SetOfferMappi
>>>ng&am 
>>>azonoffer=m1.small&cloudoffer=ef2537ad-c70f-11e1-821b-0800277e749c
>>>[1] 10596
>>>[2] 10597
>>>yoyo:citrix runseb$ <html><head><title>Apache Tomcat/6.0.35
- Error
>>>report</title><style><!--H1
>>>{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#52
>>>5D76;
>>>font-size:22px;}
>>>H2
>>>{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#52
>>>5D76;
>>>font-size:16px;}
>>>H3
>>>{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#52
>>>5D76;
>>>font-size:14px;}
>>>BODY
>>>{font-family:Tahoma,Arial,sans-serif;color:black;background-color:whi
>>>te;}
>>>B
>>>{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#52
>>>5D76;
>>>}
>>>P
>>>{font-family:Tahoma,Arial,sans-serif;background:white;color:black;fon
>>>t-siz
>>>e:12px;}A
>>>{color : black;}A.name {color : black;}HR {color :
>>>#525D76;}--></style> </head><body><h1>HTTP Status 530
- Missing 
>>>AWSAccessKeyId parameter</h1><HR size="1"
>>>noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b>

>>><u>Missing AWSAccessKeyId parameter</u></p><p><b>description</b>
>>><u>Cannot find message associated with key http.530</u></p><HR
size="1"
>>>noshade="noshade"><h3>Apache Tomcat/6.0.35</h3></body></html>
>>>[1]-  Done                    curl
>>>http://192.168.56.103:8090/bridge/rest/AmazonEC2?Action=SetOfferMapping
>>>[2]+  Done                    amazonoffer=m1.small
>>>
>>>Do I need to add the key ? the docs don't mention it.
>>>
>>>I also set the mapping with cloud-setup-bridge cmd:
>>>
>>>[root@manager sebgoa]# cloud-setup-bridge Welcome to the CloudBridge 
>>>setup.
>>>Enter suitable values or press enter for default.
>>>
>>>Management server hostname or IP [192.168.56.102]:
>>>Management server port [8080]:
>>>Service offering ID for m1.small [ef2537ad-c70f-11e1-821b-0800277e749c]:
>>>Service offering ID for m1.large [2]:
>>>
>>>But that does not seem to work either.
>>>
>>>--
>>>---
>
> I got the call properly figure out but now I get a db error:
>
> 2012-07-18 15:26:20,812 INFO  [bridge.service.EC2RestServlet]
> (catalina-exec-6:) Request queryString:
> AWSAccessKeyId=wHTzTA7o36L9atVVkTSeT7dqXYCnC_3CT4KlhdZtPsLiL_-x0vhM94v
> rnYz9CYZhsfL74dHl4HRW
> nyAsKS2ecA&Action=SetOfferMapping&SignatureMethod=HmacSHA1&SignatureVe
> rsion=2&Timestamp=2012-07-18T15:46:03Z&Version=2010-11-15&amazonoffer=
> m1.small&cloudoffer=ef2537ad-c70f-11e1-821b-0800277e7
> 49c&Signature=uJbDxiVQ02UxoFsdU84ducVKjfE%3D
> 2012-07-18 15:26:20,812 INFO  [bridge.service.EC2RestServlet]
> (catalina-exec-6:) Request requestURI: /bridge/rest/AmazonEC2
> 2012-07-18 15:26:20,812 INFO  [bridge.service.EC2RestServlet]
> (catalina-exec-6:) Request requestURL:
> http://192.168.56.103:8090/bridge/rest/AmazonEC2
> 2012-07-18 15:26:20,812 INFO  [bridge.service.EC2RestServlet]
> (catalina-exec-6:) Request servletPath: /rest/AmazonEC2
> 2012-07-18 15:26:20,812 INFO  [bridge.service.EC2RestServlet]
> (catalina-exec-6:) Request header host:192.168.56.103:8090
> 2012-07-18 15:26:20,813 INFO  [bridge.service.EC2RestServlet]
> (catalina-exec-6:) Request header user-agent:Python-urllib/1.17
> 2012-07-18 15:26:20,813 INFO  [bridge.service.EC2RestServlet]
> (catalina-exec-6:) Request parameter amazonoffer:m1.small
> 2012-07-18 15:26:20,813 INFO  [bridge.service.EC2RestServlet]
> (catalina-exec-6:) Request parameter Action:SetOfferMapping
> 2012-07-18 15:26:20,813 INFO  [bridge.service.EC2RestServlet]
> (catalina-exec-6:) Request parameter
> cloudoffer:ef2537ad-c70f-11e1-821b-0800277e749c
> 2012-07-18 15:26:20,813 INFO  [bridge.service.EC2RestServlet]
> (catalina-exec-6:) Request parameter SignatureMethod:HmacSHA1
> 2012-07-18 15:26:20,813 INFO  [bridge.service.EC2RestServlet]
> (catalina-exec-6:) Request parameter
> AWSAccessKeyId:wHTzTA7o36L9atVVkTSeT7dqXYCnC_3CT4KlhdZtPsLiL_-x0vhM94v
> rnYz9CYZhsfL74dHl4HRWnyA
> sKS2ecA
> 2012-07-18 15:26:20,814 INFO  [bridge.service.EC2RestServlet]
> (catalina-exec-6:) Request parameter Version:2010-11-15
> 2012-07-18 15:26:20,814 INFO  [bridge.service.EC2RestServlet]
> (catalina-exec-6:) Request parameter SignatureVersion:2
> 2012-07-18 15:26:20,814 INFO  [bridge.service.EC2RestServlet]
> (catalina-exec-6:) Request parameter
> Signature:uJbDxiVQ02UxoFsdU84ducVKjfE=
> 2012-07-18 15:26:20,814 INFO  [bridge.service.EC2RestServlet]
> (catalina-exec-6:) Request parameter Timestamp:2012-07-18T15:46:03Z
> 2012-07-18 15:26:20,822 DEBUG [bridge.service.UserContext]
> (catalina-exec-6:) initializing a new [anonymous] UserContext!
> 2012-07-18 15:26:20,829 ERROR [bridge.service.EC2RestServlet]
> (catalina-exec-6:) SetOfferMapping Data truncation: Data too long for 
> column 'CloudStackOffering' at row 1
> com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for 
> column 'CloudStackOffering' at row 1
>
>

Thanks to Jose Rozanec for the solution:

mysql> drop table offering_bundle;
Query OK, 0 rows affected (0.01 sec)

mysql> CREATE TABLE `offering_bundle` (`ID` int(11) NOT NULL
AUTO_INCREMENT,`AmazonEC2Offering` varchar(100) NOT NULL,`CloudStackOffering` varchar(100)
NOT NULL,PRIMARY KEY (`ID`),UNIQUE KEY `one_offering` (`AmazonEC2Offering`)) ENGINE=InnoDB
AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.01 sec)

mysql> select * from offering_bundle;
+----+-------------------+--------------------------------------+
| ID | AmazonEC2Offering | CloudStackOffering                   |
+----+-------------------+--------------------------------------+
|  2 | m1.small          | ef2537ad-c70f-11e1-821b-0800277e749c |
+----+-------------------+--------------------------------------+
1 row in set (0.00 sec)

mysql>


Is there a bug filed for this ?

--
---
Sebastien Goasguen
Open Source Cloud Evangelist, Cloudstack http://sites.google.com/site/runseb/

Mime
View raw message