I'm trying to deploy EC2 instance by Foreman. I have created compute
resources and i can retrieve regions from my Amazon account. But when i try
to crate new host i got error:
Adding Compute instance for ec2.test.domain.com
KeyPair Load (0.4ms) SELECT "key_pairs".* FROM "key_pairs" WHERE
"key_pairs"."compute_resource_id" = 1 LIMIT 1
Image Load (0.2ms) SELECT "images".* FROM "images" WHERE
"images"."compute_resource_id" = 1 AND "images"."uuid" = 'ami-26781e16'
LIMIT 1
creating VM with the following options: {"name"=>"ec2.test.domain.com",
"flavor_id"=>"m1.small", "key_pair"=>#<KeyPair id: 1, secret: "-----BEGIN
RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEApL/…", compute_resource_id: 1,
name: "foreman-16e3aa080-d5ad-4f51-8e03-8d48603cc89f", created_at:
"2014-04-24 14:10:07", updated_at: "2014-04-24 14:10:07", public: nil>,
"availability_zone"=>"", "subnet_id"=>"subnet-b9f218da",
"security_group_ids"=>[], "managed_ip"=>"private",
"image_id"=>"ami-26781e16", "tags"=>{"Name"=>"ec2.test.domain.com"}}
Started GET "/tasks/df322366-954a-4633-9077-86e6d3b5f33c" for 172.24.103.82
at 2014-04-25 15:41:39 +0000
Processing by TasksController#show as /
Parameters: {"id"=>"df322366-954a-4633-9077-86e6d3b5f33c"}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1
LIMIT 1 [["id", 1]]
Setting current user thread-local variable to admin
Rendered tasks/_list.html.erb (0.6ms)
Completed 200 OK in 3ms (Views: 1.1ms | ActiveRecord: 0.2ms)
Fog error: The key pair 'foreman-16e3aa080-d5ad-4f51-8e03-8d48603cc89f'
does not exist
As I understand foreman should copy this key pair to the Amazon, but it
doesn't find it. Should I extract private key from foreman DB and copy to
some location?
> Fog error: The key pair 'foreman-16e3aa080-d5ad-4f51-8e03-8d48603cc89f'
> does not exist
>
> As I understand foreman should copy this key pair to the Amazon, but it
> doesn't find it. Should I extract private key from foreman DB and copy to
> some location?
something bad happened during upload. The easiest method to fix this is
what you think of - copy and paste with the same key id to EC2 and it
should work fine.
Or you can delete the compute resource and keypair (via console) and
start over.
>
> Hello,
>
> > Fog error: The key pair 'foreman-16e3aa080-d5ad-4f51-8e03-8d48603cc89f'
> > does not exist
> >
> > As I understand foreman should copy this key pair to the Amazon, but it
> > doesn't find it. Should I extract private key from foreman DB and copy
> to
> > some location?
>
something bad happened during upload. The easiest method to fix this is
> what you think of - copy and paste with the same key id to EC2 and it
> should work fine.
>
> Or you can delete the compute resource and keypair (via console) and
> start over.
>
> –
> Later,
>
> Lukas "lzap" Zapletal
> irc: lzap #theforeman
>
Thanks Lukas, it really helps. I have recreated compute resources and all
work fine.
···
On Monday, April 28, 2014 11:12:23 AM UTC+3, Lukas Zapletal wrote:
I'm using foreman 1.8.2 (upgraded from 1.5.0) and ec2 compute resource
seems to be broken. Here's what I observe:
Foreman GUI, update to EC2 compute resource doesn't update database
value. Change name description, from the GUI and check DB table
("compute_resources")
Creating an instance using EC2 compute resource seems to use a bogus,
non-existent key pair. foreman-xxxx-xxx. Check the DB table ("key_pairs")
and I don't see any name that matches the one used by Foreman.
Adding another EC2 compute resource for testing. Check the DB tables
("compute_resources" as well as "key_pairs") and I don't see the new
resource added.
Delete EC2 compute resource from GUI. Check DB table
("compute_resources") and the entries are still there.
Anyone has similar issues? Anyone successfully used Foreman EC2
provisioning with Puppet integration, etc.?
Thanks for the help.
···
On Monday, April 28, 2014 at 2:57:19 AM UTC-7, andrii wrote:
>
>
>
> On Monday, April 28, 2014 11:12:23 AM UTC+3, Lukas Zapletal wrote:
>>
>> Hello,
>>
>> > Fog error: The key pair 'foreman-16e3aa080-d5ad-4f51-8e03-8d48603cc89f'
>> > does not exist
>> >
>> > As I understand foreman should copy this key pair to the Amazon, but it
>> > doesn't find it. Should I extract private key from foreman DB and copy
>> to
>> > some location?
>>
> something bad happened during upload. The easiest method to fix this is
>> what you think of - copy and paste with the same key id to EC2 and it
>> should work fine.
>>
>> Or you can delete the compute resource and keypair (via console) and
>> start over.
>>
>> --
>> Later,
>>
>> Lukas "lzap" Zapletal
>> irc: lzap #theforeman
>>
>
> Thanks Lukas, it really helps. I have recreated compute resources and all
> work fine.
>
>
> --
> Andrii
>