PIONEERS PIAF2 in Amazon EC2

panteradrummer66

New Member
Joined
Dec 6, 2010
Messages
37
Reaction score
0
Thanks Tom. As you can see, I just created a 64-bit version of the AMI I created earlier, and encourage anyone to fire up a micro instance of their own. (micro instances are free for a year). It's less buggy than the 32bit one, and works "out of the box."

The only hurdle is that the micro instances are low on RAM, so installs go fairly slow. But if you have time to kill, and are the only one using your PBX, micro instances aren't all that bad. But for companies that want more, i'd recommend a large instance for more horsepower.


I'll be interested to see the incrediblepbx run on 2.10 when it's complete.
 

panteradrummer66

New Member
Joined
Dec 6, 2010
Messages
37
Reaction score
0
You shouldn't be challenged with any login. you need to make sure that putty is using the .pem keyfile you downloaded.

Use PuTTyGen to generate a .ppk file.

Then, under the connection settings, expand SSH and click the AUTH setting. Point PuTTy to your ppk file, and under session, you should use root@(whatever your public DNS is).

This tutorial should help: http://www.powercram.com/2009/07/connecting-to-aws-ec2-instance-linux.html
 

panteradrummer66

New Member
Joined
Dec 6, 2010
Messages
37
Reaction score
0
Tom,

It seems that the scripts in pbx-menu aren't detecting the PIAF version. This could very well be because it's not a proper ISO install. Any ideas as to how to set that variable and/or where it's looking to detect the PIAF version?
 

panteradrummer66

New Member
Joined
Dec 6, 2010
Messages
37
Reaction score
0
Can't find the value for PIAF Family Version

I have checked the registry database, and anywhere i can think of to try and find where the install-incredpbx3 gets the value for PIAF Family Version.

even compared it to a version installed with the ISO. I just can't seem to find where that value is located in the os. Any help would be appreciated.

And I know i'm doing something VERY UNSUPPORTED by running this on an EC2 instance.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,206
Reaction score
5,228
There are a number of hidden files there, too, i.e. so be sure to search for the .files as well.
 

panteradrummer66

New Member
Joined
Dec 6, 2010
Messages
37
Reaction score
0
Thanks Ward.

That's actually how I found the new file names. just did a grep for "2061"

I then compared the files from an ISO install and added a few more such as install method, and install date. I'm still testing the machine to ensure all is working from an install and script running perspective. As soon as I'm done, I will create a new AMI.

For now, i'm only working with the 64-bit option since it seems less buggy than the i386 version. Once the 64-bit AMI is set, i'll continue working on the 32-bit option.
 

panteradrummer66

New Member
Joined
Dec 6, 2010
Messages
37
Reaction score
0
And we have liftoff! I have replaced the existing AMI with tne updated version that enables the pbx-menu scripts to detect the appropriate version of PAIF.

the AMI name is still "CentOS-6.2-PIAF-2.0.6.2-x86-64." After launching the instance, run the following commands:

service asterisk start
chkconfig asterisk on

After that, feel free to run update-programs to get the latest install scripts.

Thanks to Ward and Darmock for their assistance, and hope I wan't too much trouble. A 32-bit version is on it's way as soon as I can work out the kinks. :cool:

Enjoy!

Steve Whitehead
 

phinphan

Active Member
Joined
Oct 19, 2007
Messages
641
Reaction score
130
I tried to find your instance without luck. Any suggestion on finding it? Did you change the name or take it down?
 

panteradrummer66

New Member
Joined
Dec 6, 2010
Messages
37
Reaction score
0
I should not work late at night...

I forgot to make the image public. It's there and should show up now.
 

panteradrummer66

New Member
Joined
Dec 6, 2010
Messages
37
Reaction score
0
32Bit Now Available

Just added a 32bit AMI. When searching, look for "CentOS-6.2-PIAF-2.0.6.2-i386." I expect this one to possibly have some issues although I haven't found any yet.

Thanks for any feedback!
 

maxim

New Member
Joined
Jan 28, 2012
Messages
1
Reaction score
0
Hi,

I tried to use you AMI's (both 32 and 64bit) but it seems that my key-pair never gets put onto your server and therefore I cannot login to the machine.

I tried to detach the EBS instance and mount from another instance - which worked. There I was that the authorized_keys file didn't have my public key inside. I put it in but once I tried to attach the EBS instance back to the EC2 instance the machine wouldn't boot anymore.

am I missing something?

ciao,

Maxim
 

Bigphil1076

New Member
Joined
May 13, 2010
Messages
1
Reaction score
0
Can't SSH to the server

I deployed the server and it seems to be up and running. But I can't access the server via SSH with or without the keys. I get "No supported authentications methods available."
 

panteradrummer66

New Member
Joined
Dec 6, 2010
Messages
37
Reaction score
0
I need to redeploy the ami's. It looks like amazons public key file Didnt get put in. Will update later tonight when it's ready to try again.

Thanks for the feedback.
 

panteradrummer66

New Member
Joined
Dec 6, 2010
Messages
37
Reaction score
0
Running into the same issue. I delete my private key and the script that is supposed to download and copy in the users key isn't working. Either that or the ssh host key needs to be re-created at instance creation. (i'm working on figuring out how to do that now)

Sit tight, and again, thanks for letting me know.
 

panteradrummer66

New Member
Joined
Dec 6, 2010
Messages
37
Reaction score
0
Working on creating a properly shared AMI

Seems Amazon's process for creating a shared AMI is a bit more difficult than originally anticipated. The instances are not pulling the users private keys and importing them where they need to be when the instance is launched.

I am working on this and will repost the AMI's when there is a solution.

Anyone's assistance is appreciated. Thanks to Bigphil1076 for his current assistance.
 

Hyksos

Guru
Joined
May 28, 2011
Messages
474
Reaction score
70
Show us the script you're using to pull the user key from the meta date at launch time since we are in the dark so far? ;)
And tell us where you put it and all so that it runs at launch.

Also you do need to remove the host key files completely and before each rebundling so that the ami will generate a new one at launch.

And of course depending on how you do it, each time you rebundle you need to make sure you deleted the authorized_keys to remove yours and redelete the host one like stated above.

And disabling root password login of course and Amazon want you to also randomize it.

What's happening when you try? You yourself can't even log in to the AMI after a launch so you think the script is failing somehow but don't know why? because is the script is indeed failing that is what should happen.
 

panteradrummer66

New Member
Joined
Dec 6, 2010
Messages
37
Reaction score
0
The script itself is in /etc/rc.d/rc.local

if [ ! -d /root/.ssh ] ; then
mkdir -p /root/.ssh
chmod 700 /root/.ssh
fi
# Fetch public key using HTTP
curl http://169.254.169.254/latest//meta-data/public-keys/0/openssh-key > /tmp/my-key
if [ $? -eq 0 ] ; then
cat /tmp/my-key >> /root/.ssh/authorized_keys
chmod 700 /root/.ssh/authorized_keys
rm /tmp/my-key
fi

I have removed the authorized_keys and ssh_host_* files, but when I rebundle, for some reason, Amazon can't remap the hard drive blocks. I am trying to do this manually, but it's taking time with each rebundle. I have attempted to just snapshot the root device after deleting the history, and keys, but when I create the AMI, I can't SSH. It seems as though the OS isn't running the rc.local script at boot.

If I can run the script at boot (after the network interface has been brought up) then the authroized_key will get pulled in correctly.

the only issue I would have at that point, would be to stop running the script after the instance is created. Since the authorized key only needs to be imported once.
 

panteradrummer66

New Member
Joined
Dec 6, 2010
Messages
37
Reaction score
0
Yep, That's it. the rc.local file is not getting run at boot. Does anyone know why that might be? Do I need to rebundle the EBS volume in order for the OS to see that it's there?

I have tested to see if it will create a file when it runs (just so I can verify if it's working) and can't seem to get that script to run at boot.
 

panteradrummer66

New Member
Joined
Dec 6, 2010
Messages
37
Reaction score
0
So no matter what, I can't seem to get the rc.local script running at boot time. I have included full paths to each command, but still no dice. that's the only piece of this puzzle that ISN'T working.

Anyone have any suggestions as to how to run the following in a script at boot? :banghead:

Code:
if [ ! -d /root/.ssh ] ; then
mkdir -p /root/.ssh
chmod 700 /root/.ssh
fi
# Fetch public key using HTTP
curl http://169.254.169.254/latest//meta-.../0/openssh-key > /tmp/my-key
if [ $? -eq 0 ] ; then
cat /tmp/my-key >> /root/.ssh/authorized_keys
chmod 700 /root/.ssh/authorized_keys
rm /tmp/my-key
fi
 

Members online

No members online now.

Forum statistics

Threads
25,825
Messages
167,852
Members
19,250
Latest member
mark-curtis
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top