1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. If you had a PIAF Forum account in the vBulletin days, log in with your old credentials. Otherwise, sign up again and we'll get you back in business as soon as we can.
  3. Please limit message subjects in new threads to 40 CHARACTERS or less! Otherwise, nobody can reply to your post! We're working on it. Suhosin sucks!

PIAF2 in Amazon EC2

Discussion in 'Developers' Corner' started by panteradrummer66, Jan 21, 2012.

  1. panteradrummer66 New Member

    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 k-i-l-l, 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.
  2. lgaetz Pundit

    It has been over a year since I tried to connect to an EC2 instance, so I am a bit rusty. I loaded an instance of your AMI above, set up a key pair and attempted to connect via putty and I got challenged with a login. Do we need to know the root password you set this up with, or am I doing something wrong?
  3. panteradrummer66 New Member

    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
  4. panteradrummer66 New Member

    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?
  5. panteradrummer66 New Member

    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.
  6. panteradrummer66 New Member

    nm I found it...now to build the files in /etc/pbx/ into the base install image...
  7. wardmundy Nerd Uno

    There are a number of hidden files there, too, i.e. so be sure to search for the .files as well.
  8. panteradrummer66 New Member

    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.
  9. panteradrummer66 New Member

    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
  10. phinphan Member

    I tried to find your instance without luck. Any suggestion on finding it? Did you change the name or take it down?
  11. panteradrummer66 New Member

    I should not work late at night...

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

    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!
  13. maxim New Member

    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
  14. Bigphil1076 New Member

    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."
  15. panteradrummer66 New Member

    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.
  16. panteradrummer66 New Member

    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.
  17. panteradrummer66 New Member

    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.
  18. Hyksos Guru

    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.
  19. panteradrummer66 New Member

    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.
  20. panteradrummer66 New Member

    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.

Share This Page