# Display AWS Ec2 IP Address in Opennebula

**URL:** <https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805>\
**Category:** Product Support\
**Created:** [February 11, 2016, 6:09pm UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805 "2016-02-11T18:09:05Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![debian112](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@debian112](https://forum.opennebula.io/u/debian112)\
**Post date:** [February 11, 2016, 6:09pm UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/1 "2016-02-11T18:09:06Z")

</div>

I have opennebula deploying instances on EC2. This works fine, but how do I get IP or DNS information to display in opennebula?

---

<div class="post-metadata">

**Author:** ![dmolina](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dmolina/32/22_2.png) [@dmolina](https://forum.opennebula.io/u/dmolina)\
**Post date:** [February 12, 2016, 8:54am UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/2 "2016-02-12T08:54:55Z")

</div>

From Sunstone, you can access this information from the Network tab after clicking an element in the VMs table.

From the CLI, all the information monitored by OpenNebula is included in the resource, onevm show VMID

---

<div class="post-metadata">

**Author:** ![debian112](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@debian112](https://forum.opennebula.io/u/debian112)\
**Post date:** [February 12, 2016, 11:57am UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/3 "2016-02-12T11:57:03Z")

</div>

Unfortunately I am unable to see the information in either locations. I also have the ec2-context.deb installed. Any idea what else I can check?

onevm show 30  
VIRTUAL MACHINE 30 INFORMATION  
ID : 30  
NAME : Copy of MyWebServer -awstesting-30  
USER : userme  
GROUP : oneadmin  
STATE : ACTIVE  
LCM\_STATE : RUNNING  
RESCHED : No  
HOST : us-east-1  
CLUSTER ID : -1  
CLUSTER : default  
START TIME : 02/11 18:32:41  
END TIME : -  
DEPLOY ID : i-469ee5c6

VIRTUAL MACHINE MONITORING

PERMISSIONS  
OWNER : um-  
GROUP : —  
OTHER : —

VM DISKS  
ID DATASTORE TARGET IMAGE SIZE TYPE SAVE  
0 - hda CONTEXT -/- - -

VIRTUAL MACHINE HISTORY  
SEQ HOST ACTION DS START TIME PROLOG  
0 us-east-1 none -1 02/11 18:33:09 0d 00h01m 0h00m00s

USER TEMPLATE  
EC2=[  
AMI=“ami-d25065b8”,  
INSTANCETYPE=“m1.small”,  
KEYPAIR=“opea” ]  
SCHED\_REQUIREMENTS="ID=“2"”

VIRTUAL MACHINE TEMPLATE  
AUTOMATIC\_REQUIREMENTS="!(PUBLIC\_CLOUD = YES) | (PUBLIC\_CLOUD = YES & (HYPERVISOR = ec2))"  
CONTEXT=[  
DISK\_ID=“0”,  
NETWORK=“YES”,  
SET\_HOSTNAME=“Copy of MyWebServer -awstesting-30”,  
SSH\_PUBLIC\_KEY=“ssh-rsa e343242Lp [user@vdad.net](mailto:user@vdad.net)”,  
TARGET=“hda” ]  
CPU="0.5"  
GRAPHICS=[  
LISTEN=“0.0.0.0”,  
PORT=“5930”,  
TYPE=“VNC” ]  
MEMORY="128"  
TEMPLATE\_ID="5"  
VMID=“30”

---

<div class="post-metadata">

**Author:** ![dmolina](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dmolina/32/22_2.png) [@dmolina](https://forum.opennebula.io/u/dmolina)\
**Post date:** [February 12, 2016, 4:21pm UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/4 "2016-02-12T16:21:02Z")

</div>

Could you check if there is any error in oned.log? btw, after instantiating the VM you have to wait for a while (depending on monitoring step in oned.conf) until this information is available in the VM.

---

<div class="post-metadata">

**Author:** ![debian112](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@debian112](https://forum.opennebula.io/u/debian112)\
**Post date:** [February 13, 2016, 11:43am UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/5 "2016-02-13T11:43:07Z")

</div>

The logs do not show any errors?

Sat Feb 13 03:29:09 2016 [Z0][ReM][D]: Req:4224 UID:0 VirtualMachineDeploy invoked , 31, 2, false, -1  
Sat Feb 13 03:29:09 2016 [Z0][DiM][D]: Deploying VM 31  
Sat Feb 13 03:29:09 2016 [Z0][ReM][D]: Req:4224 UID:0 VirtualMachineDeploy result SUCCESS, 31  
Sat Feb 13 03:29:09 2016 [Z0][VMM][D]: Message received: LOG I 31 Successfully execute network driver operation: pre.

Sat Feb 13 03:29:09 2016 [Z0][ReM][D]: Req:6032 UID:0 VirtualMachineInfo invoked , 31  
Sat Feb 13 03:29:09 2016 [Z0][ReM][D]: Req:6032 UID:0 VirtualMachineInfo result SUCCESS, "31…"  
Sat Feb 13 03:29:09 2016 [Z0][ReM][D]: Req:8480 UID:2 VirtualMachinePoolInfo invoked , -2, 0, -2000, -1  
Sat Feb 13 03:29:09 2016 [Z0][ReM][D]: Req:8480 UID:2 VirtualMachinePoolInfo result SUCCESS, "\<VM\_POOL\>0\</…"  
Sat Feb 13 03:29:10 2016 [Z0][ReM][D]: Req:3600 UID:2 VirtualMachinePoolInfo invoked , -2, 0, -2000, -1  
Sat Feb 13 03:29:10 2016 [Z0][ReM][D]: Req:3600 UID:2 VirtualMachinePoolInfo result SUCCESS, "\<VM\_POOL\>0\</…"  
Sat Feb 13 03:29:11 2016 [Z0][VMM][D]: Message received: LOG I 31 Successfully execute virtualization driver operation: deploy.

Sat Feb 13 03:29:11 2016 [Z0][VMM][D]: Message received: LOG I 31 Successfully execute network driver operation: post.

Sat Feb 13 03:29:11 2016 [Z0][VMM][D]: Message received: DEPLOY SUCCESS 31 i-93226e13

Sat Feb 13 03:29:27 2016 [Z0][ImM][D]: Datastore system (0) successfully monitored.

---

<div class="post-metadata">

**Author:** ![debian112](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@debian112](https://forum.opennebula.io/u/debian112)\
**Post date:** [February 13, 2016, 11:47am UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/6 "2016-02-13T11:47:37Z")

</div>

EC2 oned.conf settings:

IM\_MAD = [  
name = “ec2”,  
executable = “one\_im\_sh”,  
arguments = “-c -t 1 -r 0 ec2” ]

#-------------------------------------------------------------------------------  
VM\_MAD = [  
name = “ec2”,  
executable = “one\_vmm\_sh”,  
arguments = “-t 15 -r 0 ec2”,  
type = “xml” ]

---

<div class="post-metadata">

**Author:** ![debian112](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@debian112](https://forum.opennebula.io/u/debian112)\
**Post date:** [February 13, 2016, 11:59am UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/7 "2016-02-13T11:59:17Z")

</div>

AWS VM STATE:  
Sat Feb 13 03:52:41 2016 [Z0][InM][D]: Host us-east-1 (2) successfully monitored.  
Sat Feb 13 03:52:41 2016 [Z0][VMM][D]: VM 29 successfully monitored: STATE=-  
Sat Feb 13 03:52:41 2016 [Z0][VMM][D]: VM 30 successfully monitored: STATE=-  
Sat Feb 13 03:52:41 2016 [Z0][VMM][D]: VM 31 successfully monitored: STATE=-  
Sat Feb 13 03:52:41 2016 [Z0][VMM][D]: VM 32 successfully monitored: STATE=-

---

<div class="post-metadata">

**Author:** ![debian112](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@debian112](https://forum.opennebula.io/u/debian112)\
**Post date:** [February 14, 2016, 12:25am UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/8 "2016-02-14T00:25:49Z")

</div>

Any other suggestions?

---

<div class="post-metadata">

**Author:** ![dmolina](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dmolina/32/22_2.png) [@dmolina](https://forum.opennebula.io/u/dmolina)\
**Post date:** [February 15, 2016, 9:16am UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/9 "2016-02-15T09:16:58Z")

</div>

Could you check if the VM has an IP in the AWS console?  
Could you also try removing the NETWORK=YES from the CONTEXT section in the template and reinstantiate the template

---

<div class="post-metadata">

**Author:** ![mmancini](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/mmancini/32/6468_2.png) [@mmancini](https://forum.opennebula.io/u/mmancini)\
**Post date:** [February 15, 2016, 9:19am UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/10 "2016-02-15T09:19:58Z")

</div>

I got the same issue with EC2 driver in our setup (OpenNebula 4.14.2); but it seems an issue related to users different from oneadmin. I found out that if the VM owner is oneadmin the AWS info are displayed otherwise no info are displayed.

---

<div class="post-metadata">

**Author:** ![debian112](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@debian112](https://forum.opennebula.io/u/debian112)\
**Post date:** [February 15, 2016, 12:25pm UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/11 "2016-02-15T12:25:57Z")

</div>

Ok so changing the vm owner to oneadmin fixes this. How can my regular user see this info because the VM will not be launched by oneadmin but by users?

---

<div class="post-metadata">

**Author:** ![dmolina](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dmolina/32/22_2.png) [@dmolina](https://forum.opennebula.io/u/dmolina)\
**Post date:** [February 15, 2016, 12:30pm UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/12 "2016-02-15T12:30:20Z")

</div>

We will take a look into this and let you know what could be the problem  
[http://dev.opennebula.org/issues/4334](http://dev.opennebula.org/issues/4334)

---

<div class="post-metadata">

**Author:** ![debian112](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@debian112](https://forum.opennebula.io/u/debian112)\
**Post date:** [February 15, 2016, 12:32pm UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/13 "2016-02-15T12:32:14Z")

</div>

Thank you, looking forward to the results and fix.

---

<div class="post-metadata">

**Author:** ![dmolina](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dmolina/32/22_2.png) [@dmolina](https://forum.opennebula.io/u/dmolina)\
**Post date:** [February 15, 2016, 5:13pm UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/14 "2016-02-15T17:13:20Z")

</div>

Hi,

I have just tested it and it’s working for me. From the log you pasted:

```auto
Sat Feb 13 03:52:41 2016 [Z0][VMM][D]: VM 29 successfully monitored: STATE=- 

```

It looks like there is a problem with the monitoring and the error is not logged by the driver. It should look like this:

```auto
Mon Feb 15 17:52:10 2016 [Z0][VMM][D]: VM 1 successfully monitored: MEMORY=0 CPU=0 NETTX=0 NETRX=0 STATE=a AWS_DNS_NAME=ec2-....compute-1.amazonaws.com AWS_PRIVATE_DNS_NAME=ip-.....ec2.internal AWS_AVAILABILITY_ZONE=us-east-1e AWS_PRIVATE_IP_ADDRESS=...AWS_IP_ADDRESS=....AWS_SECURITY_GROUPS=sg-AWS_INSTANCE_TYPE=t1.micro AWS_IMAGE_ID=ami-

```

Could you try changing the following line in [/usr/lib/one/ruby/ec2\_driver.rb:558](https://github.com/OpenNebula/one/blob/master/src/vmm_mad/remotes/ec2/ec2_driver.rb#L558) to:

```ruby
        rescue => e
            STDERR.puts(e.message)
            exit(-1)
        end

```

Restart oned and check /var/log/one/oned.log for the error. Probably there is a problem with the aws-sdk version, I have tested with aws-sdk (1.33.0)

---

<div class="post-metadata">

**Author:** ![debian112](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@debian112](https://forum.opennebula.io/u/debian112)\
**Post date:** [February 15, 2016, 5:48pm UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/15 "2016-02-15T17:48:27Z")

</div>

Can you place the surrounded code around that statement you want me add? For some reason line 558 is different for me, or place the entire file with changes on [paste.debian.net](http://paste.debian.net)

By the way, I am also using the same version: /var/lib/gems/2.1.0/gems/aws-sdk-1.33.0/bin/aws-rb

---

<div class="post-metadata">

**Author:** ![mmancini](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/mmancini/32/6468_2.png) [@mmancini](https://forum.opennebula.io/u/mmancini)\
**Post date:** [February 16, 2016, 9:41am UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/16 "2016-02-16T09:41:12Z")

</div>

If i substitute the actual ec2\_driver.rb (OpenNebula version 4.14.2) with the file ec2\_driver.rb from github it works; the AWS info are displayed also for regular users.

---

<div class="post-metadata">

**Author:** ![dmolina](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dmolina/32/22_2.png) [@dmolina](https://forum.opennebula.io/u/dmolina)\
**Post date:** [February 16, 2016, 9:55am UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/17 "2016-02-16T09:55:00Z")

</div>

Ok, I found out the problem and as Marco said it is already fixed in the repo. This is the commit that fixes the problem, you can modify your file to include the INFO\_ALL\_VM flag or just replace the ec2\_driver.rb file with the one in the the repo.

[https://github.com/OpenNebula/one/commit/248f1879656dd75b34ea4cc716f7a24e7b0050d0](https://github.com/OpenNebula/one/commit/248f1879656dd75b34ea4cc716f7a24e7b0050d0)

---

<div class="post-metadata">

**Author:** ![debian112](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@debian112](https://forum.opennebula.io/u/debian112)\
**Post date:** [February 16, 2016, 12:35pm UTC](https://forum.opennebula.io/t/display-aws-ec2-ip-address-in-opennebula/1805/18 "2016-02-16T12:35:10Z")

</div>

Thank you, the problem is resolved! I will check github first in the future.
