Discussion:
AWS: request both public and specific private IP on new instance.
James Masson
2014-05-06 16:11:55 UTC
Permalink
Hi,

we're trying to use Fog to create a new instance in a VPC, with
simultaneous non-EIP Public and specific Private IPs.

Command is of the format:

connection.servers.create(
:vpc_id => vpc.id,
:subnet_id => sn_public.subnet_id,
:image_id => 'ami-ed352799',
:flavor_id => 't1.micro',
:private_ip_address => '10.250.0.5',
:associate_public_ip => true,
:tags => {'Name' =>
'NAT::'+vpc.id+'::'+sn_public.subnet_id})


this blows up with:

Fog::Compute::AWS::Error: InvalidParameterCombination => Network interfaces
and an instance-level private IP address may not be specified on the same
request
from
/Users/.rbenv/versions/2.0.0-p451/gemsets/ccp-api/gems/excon-0.33.0/lib/excon/middlewares/expects.rb:6:in
`response_call'

Some googling brings me - https://github.com/aws/aws-cli/pull/502

If I remove either the request for the specific private ip
(private_ip_address) - or the request for a private IP
(associate_public_ip) - the request succeeds.

I'm thinking that my use case requires some network object syntax magic for
this combination to work. Any ideas?

thanks

James M
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Suresh Prajapati
2014-05-07 07:14:27 UTC
Permalink
Hi James,

I think you need to specify the network interface as well.


# * 'AssociatePublicIpAddress'<~String> - Indicates whether to assign a
public IP address to an instance in a VPC. The public IP address is
assigned to a specific network interface
From fog code

https://github.com/fog/fog/blob/master/lib/fog/aws/requests/compute/run_instances.rb#L44

My notion is that , while creating the instance , it getting confused where
to assign which IP.
Post by James Masson
Hi,
we're trying to use Fog to create a new instance in a VPC, with
simultaneous non-EIP Public and specific Private IPs.
connection.servers.create(
:vpc_id => vpc.id,
:subnet_id => sn_public.subnet_id,
:image_id => 'ami-ed352799',
:flavor_id => 't1.micro',
:private_ip_address => '10.250.0.5',
:associate_public_ip => true,
:tags => {'Name' => 'NAT::'+vpc.id
+'::'+sn_public.subnet_id})
Fog::Compute::AWS::Error: InvalidParameterCombination => Network
interfaces and an instance-level private IP address may not be specified on
the same request
from
/Users/.rbenv/versions/2.0.0-p451/gemsets/ccp-api/gems/excon-0.33.0/lib/excon/middlewares/expects.rb:6:in
`response_call'
Some googling brings me - https://github.com/aws/aws-cli/pull/502
If I remove either the request for the specific private ip
(private_ip_address) - or the request for a private IP
(associate_public_ip) - the request succeeds.
I'm thinking that my use case requires some network object syntax magic
for this combination to work. Any ideas?
thanks
James M
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Best Regards,
Suresh Prajapati
Mob No: +91-9000173245
----------------------------------------------------------------------------------------
Theory is when you know all and nothing works. Practice is when all works
and nobody knows why. In this case we have put together theory and
practice: nothing works... and nobody knows why!
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
James Masson
2014-05-07 10:14:46 UTC
Permalink
Thanks for the hint. This is what worked for us...

nat = connection.servers.create(
:vpc_id => vpc.id,
:image_id => 'ami-ed352799',
:flavor_id => 't1.micro',
:tags => {'Name' =>
'NAT::'+vpc.id+'::'+sn_public.subnet_id},
:network_interfaces => [{
'DeviceIndex' => '0',
'PrivateIpAddress' =>
'10.250.0.5',
'AssociatePublicIpAddress' => true,
'SubnetId' =>
sn_public.subnet_id
}])

nat.wait_for{ ready? }


regards

James M
Post by Suresh Prajapati
Hi James,
I think you need to specify the network interface as well.
# * 'AssociatePublicIpAddress'<~String> - Indicates whether to assign
a public IP address to an instance in a VPC. The public IP address is
assigned to a specific network interface
From fog code
https://github.com/fog/fog/blob/master/lib/fog/aws/requests/compute/run_instances.rb#L44
My notion is that , while creating the instance , it getting confused
where to assign which IP.
Post by James Masson
Hi,
we're trying to use Fog to create a new instance in a VPC, with
simultaneous non-EIP Public and specific Private IPs.
connection.servers.create(
:vpc_id => vpc.id,
:subnet_id => sn_public.subnet_id,
:image_id => 'ami-ed352799',
:flavor_id => 't1.micro',
:private_ip_address => '10.250.0.5',
:associate_public_ip => true,
:tags => {'Name' => 'NAT::'+vpc.id
+'::'+sn_public.subnet_id})
Fog::Compute::AWS::Error: InvalidParameterCombination => Network
interfaces and an instance-level private IP address may not be specified on
the same request
from
/Users/.rbenv/versions/2.0.0-p451/gemsets/ccp-api/gems/excon-0.33.0/lib/excon/middlewares/expects.rb:6:in
`response_call'
Some googling brings me - https://github.com/aws/aws-cli/pull/502
If I remove either the request for the specific private ip
(private_ip_address) - or the request for a private IP
(associate_public_ip) - the request succeeds.
I'm thinking that my use case requires some network object syntax magic
for this combination to work. Any ideas?
thanks
James M
--
You received this message because you are subscribed to the Google Groups
"ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Best Regards,
Suresh Prajapati
Mob No: +91-9000173245
----------------------------------------------------------------------------------------
Theory is when you know all and nothing works. Practice is when all works
and nobody knows why. In this case we have put together theory and
practice: nothing works... and nobody knows why!
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
geemus (Wesley Beary)
2014-05-07 15:28:00 UTC
Permalink
Thanks for the update, good to know there was a way to work around the
issue already available.
Post by James Masson
Thanks for the hint. This is what worked for us...
nat = connection.servers.create(
:vpc_id => vpc.id,
:image_id => 'ami-ed352799',
:flavor_id => 't1.micro',
:tags => {'Name' => 'NAT::'+vpc.id
+'::'+sn_public.subnet_id},
:network_interfaces => [{
'DeviceIndex' => '0',
'PrivateIpAddress' =>
'10.250.0.5',
'AssociatePublicIpAddress' => true,
'SubnetId' =>
sn_public.subnet_id
}])
nat.wait_for{ ready? }
regards
James M
Post by Suresh Prajapati
Hi James,
I think you need to specify the network interface as well.
# * 'AssociatePublicIpAddress'<~String> - Indicates whether to assign
a public IP address to an instance in a VPC. The public IP address is
assigned to a specific network interface
From fog code
https://github.com/fog/fog/blob/master/lib/fog/aws/requests/compute/run_
instances.rb#L44
My notion is that , while creating the instance , it getting confused
where to assign which IP.
Post by James Masson
Hi,
we're trying to use Fog to create a new instance in a VPC, with
simultaneous non-EIP Public and specific Private IPs.
connection.servers.create(
:vpc_id => vpc.id,
:subnet_id => sn_public.subnet_id,
:image_id => 'ami-ed352799',
:flavor_id => 't1.micro',
:private_ip_address => '10.250.0.5',
:associate_public_ip => true,
:tags => {'Name' => 'NAT::'+vpc.id+'::'+sn_public.
subnet_id})
Fog::Compute::AWS::Error: InvalidParameterCombination => Network
interfaces and an instance-level private IP address may not be specified on
the same request
from /Users/.rbenv/versions/2.0.0-p451/gemsets/ccp-api/gems/
excon-0.33.0/lib/excon/middlewares/expects.rb:6:in `response_call'
Some googling brings me - https://github.com/aws/aws-cli/pull/502
If I remove either the request for the specific private ip
(private_ip_address) - or the request for a private IP
(associate_public_ip) - the request succeeds.
I'm thinking that my use case requires some network object syntax magic
for this combination to work. Any ideas?
thanks
James M
--
You received this message because you are subscribed to the Google
Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
Best Regards,
Suresh Prajapati
Mob No: +91-9000173245
------------------------------------------------------------
----------------------------
Theory is when you know all and nothing works. Practice is when all works
and nobody knows why. In this case we have put together theory and
practice: nothing works... and nobody knows why!
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Loading...