Add Amazon EC2 Host failed

Hi,.

I am trying to add EC2 host, it always shows error in sunstone.
The system is setup without problem, sunstone is managing 2 OpenNebula node.

oned.log
Thu Jul 21 12:34:54 2016 [Z0][InM][D]: Monitoring host node1 (9) Thu Jul 21 12:34:54 2016 [Z0][InM][D]: Monitoring host ec2 (11) Thu Jul 21 12:34:54 2016 [Z0][MKP][D]: Monitoring marketplace OpenNebula Public (0) Thu Jul 21 12:34:54 2016 [Z0][InM][D]: Monitoring datastore default (1) Thu Jul 21 12:34:54 2016 [Z0][InM][D]: Monitoring datastore files (2) Thu Jul 21 12:34:55 2016 [Z0][MKP][I]: /usr/share/ruby/net/http.rb:878:ininitialize’: getaddrinfo: Name or service not known (SocketError)
Thu Jul 21 12:34:55 2016 [Z0][MKP][I]: from /usr/share/ruby/net/http.rb:878:in open' Thu Jul 21 12:34:55 2016 [Z0][MKP][I]: from /usr/share/ruby/net/http.rb:878:inblock in connect’
Thu Jul 21 12:34:55 2016 [Z0][MKP][I]: from /usr/share/ruby/timeout.rb:52:in timeout' Thu Jul 21 12:34:55 2016 [Z0][MKP][I]: from /usr/share/ruby/net/http.rb:877:inconnect’
Thu Jul 21 12:34:55 2016 [Z0][MKP][I]: from /usr/share/ruby/net/http.rb:862:in do_start' Thu Jul 21 12:34:55 2016 [Z0][MKP][I]: from /usr/share/ruby/net/http.rb:851:instart’
Thu Jul 21 12:34:55 2016 [Z0][MKP][I]: from /usr/share/ruby/net/http.rb:582:in start' Thu Jul 21 12:34:55 2016 [Z0][MKP][I]: from /var/lib/one/remotes/market/one/monitor:41:inget’
Thu Jul 21 12:34:55 2016 [Z0][MKP][I]: from /var/lib/one/remotes/market/one/monitor:53:in get_appliances' Thu Jul 21 12:34:55 2016 [Z0][MKP][I]: from /var/lib/one/remotes/market/one/monitor:157:in'
Thu Jul 21 12:34:55 2016 [Z0][MKP][I]: ExitCode: 1
Thu Jul 21 12:34:55 2016 [Z0][MKP][E]: Error monitoring datastore 0: -
Thu Jul 21 12:34:55 2016 [Z0][ImM][D]: Datastore files (2) successfully monitored.
Thu Jul 21 12:34:55 2016 [Z0][ImM][D]: Datastore default (1) successfully monitored.
Thu Jul 21 12:34:56 2016 [Z0][InM][I]: Command execution fail: /var/lib/one/remotes/im/run_probes ec2 /var/lib/one//datastores 4124 20 11 ec2
Thu Jul 21 12:34:56 2016 [Z0][InM][I]: /usr/share/ruby/psych.rb:205:in parse': (<unknown>): found character that cannot start any token while scanning for the next token at line 9 column 1 (Psych::SyntaxError) Thu Jul 21 12:34:56 2016 [Z0][InM][I]: from /usr/share/ruby/psych.rb:205:inparse_stream’
Thu Jul 21 12:34:56 2016 [Z0][InM][I]: from /usr/share/ruby/psych.rb:153:in parse' Thu Jul 21 12:34:56 2016 [Z0][InM][I]: from /usr/share/ruby/psych.rb:129:inload’
Thu Jul 21 12:34:56 2016 [Z0][InM][I]: from /usr/lib/one/ruby/ec2_driver.rb:218:in initialize' Thu Jul 21 12:34:56 2016 [Z0][InM][I]: from ./poll:33:innew’
Thu Jul 21 12:34:56 2016 [Z0][InM][I]: from ./poll:33:in <main>' Thu Jul 21 12:34:56 2016 [Z0][InM][E]: Error executing poll Thu Jul 21 12:34:56 2016 [Z0][InM][I]: ExitCode: 1 Thu Jul 21 12:34:56 2016 [Z0][ONE][E]: Error monitoring Host ec2 (11): Error executing poll Thu Jul 21 12:34:57 2016 [Z0][InM][D]: Host node1 (9) successfully monitored. Thu Jul 21 12:34:59 2016 [Z0][InM][D]: Host node2 (10) successfully monitored.

ec2_driver.conf
proxy_uri: state_wait_timeout_seconds: 300 regions: default: region_name: us-east-1 access_key_id: XXXXXXXXX secret_access_key: XXXXXXXXXXX capacity: t2.micro: 5 m1.small: m1.large: m1.xlarge

oned.conf
IM_MAD = [
NAME = “ec2”,
SUNSTONE_NAME = “Amazon EC2”,
EXECUTABLE = “one_im_sh”,
ARGUMENTS = “-c -t 1 -r 0 ec2” ]

VM_MAD = [
NAME = “ec2”,
SUNSTONE_NAME = “Amazon EC2”,
EXECUTABLE = “one_vmm_sh”,
ARGUMENTS = “-t 15 -r 0 ec2”,
TYPE = “xml”,
KEEP_SNAPSHOTS = “no”,
IMPORTED_VMS_ACTIONS = “terminate, terminate-hard, hold, release, suspend,
resume, delete, reboot, reboot-hard, resched, unresched, poweroff,
poweroff-hard, disk-attach, disk-detach, nic-attach, nic-detach,
snap-create, snap-delete”
]

[root@node1 ~]# gem list | grep aws
aws-sdk (2.4.0, 1.66.0)
aws-sdk-core (2.4.0)
aws-sdk-resources (2.4.0)
aws-sdk-v1 (1.66.0)

Hi,

Can you tell us your OpenNebula version, ruby version, and distro?

Hi Martin

I am running CentOS, below are the details. I am new to CentOS, if anything missing please let me know the command, I will dump it. Thanks.

[root@node1 ~]# gem -v
2.0.14

[oneadmin@node1 root]$ oned -v
Copyright 2002-2016, OpenNebula Project, OpenNebula Systems

OpenNebula 5.0.1 is distributed and licensed for use under the terms of the
Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0).

[oneadmin@node1 root]$ hostnamectl
Static hostname: node1
Icon name: computer-vm
Chassis: vm
Machine ID: d08a5217ba8443f7bbe85c56a0e5ea77
Boot ID: 3d58393b9d4249b8bd4b5c5c633dbfdd
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-327.22.2.el7.x86_64
Architecture: x86-64
[oneadmin@node1 root]$

Can you please double check that your ec2_driver.conf has a valid yaml syntax?

I have upload only the relevant part, all other part in the file is unchanged

proxy_uri:
state_wait_timeout_seconds: 300
regions:
    default:
        region_name: us-east-1
        access_key_id: XXXXXXXXXXXXX
        secret_access_key: XXXXXXXXXXXXXXXX
        capacity:
            t2.micro: 5
            m1.small:
            m1.large:
            m1.xlarge

instance_types:
    t2.micro:
        cpu: 1
        memory: 1.0


Does it validate as correct yaml?

Hi Martin.

You are genius, I just check with YAML parser, and fix those error. After reboot, It still not working.

oned.log output

Thu Jul 21 17:42:36 2016 [Z0][InM][I]: Command execution fail: /var/lib/one/remotes/im/run_probes ec2 /var/lib/one//datastores 4124 20 11 ec2
Thu Jul 21 17:42:36 2016 [Z0][InM][I]: getaddrinfo: Name or service not known
Thu Jul 21 17:42:36 2016 [Z0][InM][E]: Error executing poll
Thu Jul 21 17:42:36 2016 [Z0][InM][I]: ExitCode: 255
Thu Jul 21 17:42:36 2016 [Z0][ONE][E]: Error monitoring Host ec2 (11): Error executing poll

Hi Martin.

I got it fixed finally, your solution works well. Thanks.

Hi,

I’m working on OpenNebula for School (Master degree) and I’ve got an issue to link OpenNebula and an AWS Virtual Machine.

Can you please help me?
Did you know a tutorial which works?

Thanks!