enable to select a specific subnet in a net when creating a vm
when a net has multiple subnets for some purposes,
this function can give selecting a specific subnet that user wants to create VMs on that subnet.
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- Joseph P
- Direction:
- Needs approval
- Assignee:
- Joseph P
- Definition:
- Obsolete
- Series goal:
- Accepted for icehouse
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
- Mark McClain
Related branches
Whiteboard
Brief code investigation shows that Neutron implementation is ready for such
functionality. When Nova invokes a new instance, it links it to specific
network by creating a new port. Port creation involves Neutron API described
at: https:/
Here we can see that API users may specify specific 'Fixed IPs'. There are two
options mentioned there: specifying both subnet and IP address, which results
in binding port to specific address, or specifying subnet id only, which will
result in non-predeterminate IP address chosen for the instance from the subnet
specified.
Speaking of neutron client, we may pass the preferred subnet as an argument as
follows:
# neutron port-create --fixed-ip subnet_id=subnet1 public
The only problem here is that help message does not suggest there's such
possibility:
# neutron port-create
usage: neutron port-create [-h] [-f {shell,table}] [-c COLUMN]
neutron port-create: error: too few arguments
Client part will be handled as:
https:/
Now proceeding to Nova part. The code used to invoke new instance and assign it
to network can be found in: nova/network/
following function is used to create a port for an instance:
API._create_port(). It's passed the following argument, among other things:
":param fixed_ip: Optional fixed IP to use from the given network." It's a
simple string representation of the desired IP address.
Assuming this works the same way as passing both subnet id and ip address.
What we miss is passing specific subnet_id instead of fixed_ip to the function,
and properly setting it for Neutron port POST request.
Conclusion: this is not really a Neutron BP, as it does not require any code changes
in this project. Changes to horizon and novaclient utilities will probably also be
needed.
nova blueprint: https:/
horizon blueprint: https:/