Setting up instances without a public IP

Follow

There will be times when you want to run an instance on Eucalyptus without a public IP; here's how: 

 

start up your instance using the --addressing private flag, as shown below:

# euca-run-instances emi-4f7d4dad -k my-first-keypair --addressing private

this will kick off an instance with only a private IP, as seen below:

# euca-describe-instances i-9da1d48b
RESERVATION r-d68f23be 591230529186 default
INSTANCE i-9da1d48b emi-4f7d4dad 10.104.14.6 10.104.14.6 running my-first-keypair 0 m1.small 2014-09-26T20:54:37.815Z default monitoring-disabled 10.104.14.6 10.104.14.6 instance-store hvm sg-00a93a79
TAG instance i-9da1d48b euca:node 10.104.10.57

The VM should be reachable via its private IP:

ssh -i my-first-keypair.pem root@10.104.14.6
[root@ip-10-104-14-6 ~]#

From here, take a look at your existing addresses (public):

# euca-describe-addresses verbose
ADDRESS 10.104.14.0 i-956939eb (arn:aws:euare::000000000000:user/eucalyptus) standard
ADDRESS 10.104.14.1 nobody standard
ADDRESS 10.104.14.2 nobody standard
ADDRESS 10.104.14.3 nobody standard
ADDRESS 10.104.14.4 nobody standard
ADDRESS 10.104.14.5 nobody standard

# euca-allocate-address
ADDRESS 10.104.14.1 standard

# euca-associate-address -i i-9da1d48b 10.104.14.1
ADDRESS 10.104.14.1 i-9da1d48b

# euca-describe-instances i-9da1d48b
RESERVATION r-d68f23be 591230529186 default
INSTANCE i-9da1d48b emi-4f7d4dad 10.104.14.1 10.104.14.6 running my-first-keypair 0 m1.small 2014-09-26T20:54:37.815Z default monitoring-disabled 10.104.14.1 10.104.14.6 instance-store hvm sg-00a93a79
TAG instance i-9da1d48b euca:node 10.104.10.57

Note the public IP now assigned. Finally, test!

# ssh -i my-first-keypair.pem root@10.104.14.1
The authenticity of host '10.104.14.1 (10.104.14.1)' can't be established.
RSA key fingerprint is 7b:c2:90:6b:93:d5:4b:ec:03:fb:d0:84:90:d0:85:87.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.104.14.1' (RSA) to the list of known hosts.
[root@ip-10-104-14-6 ~]#

Now that we have a public IP, you can do whatever you wan to the instance. Once you're done, simply remove the elastic IP assigned:

# euca-disassociate-address 10.104.14.1
ADDRESS 10.104.14.1

Your instance should now be back to just a private IP:

# euca-describe-instances i-9da1d48b
RESERVATION r-d68f23be 591230529186 default
INSTANCE i-9da1d48b emi-4f7d4dad 10.104.14.6 10.104.14.6 running my-first-keypair 0 m1.small 2014-09-26T20:54:37.815Z default monitoring-disabled 10.104.14.6 10.104.14.6 instance-store hvm sg-00a93a79
TAG instance i-9da1d48b euca:node 10.104.10.57

Let me know if you have any questions on this process, I'd be delighted to help in any way I can.

Have more questions? Submit a request

Comments

Powered by Zendesk