Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Rackspace/Openstack - Add/enhance --*-net-* create switches. #2974

Merged

Conversation

robertjustjones
Copy link
Contributor

This is a rebase/reopen for #1451 so see relevant history there please. This addresses issues #1440 and #1444.

@dgageot
Copy link
Member

dgageot commented Feb 18, 2016

Hi @robertjustjones What about the compatibility with existing machines? Changing the fields of Driver can make it incompatible with existing config.json files. Can you try?

@dgageot
Copy link
Member

dgageot commented Feb 18, 2016

ping @fsoppelsa

@fsoppelsa
Copy link
Contributor

@dgageot @robertjustjones sorry for the delay, tried it (without looking at code), but:

$ neutron net-list
+--------------------------------------+---------+-------------------------------------------------------+
| id                                   | name    | subnets                                               |
+--------------------------------------+---------+-------------------------------------------------------+
| 095f43ed-65ba-48ce-8185-d4080e430a88 | public  | 2e7a11f5-4c2b-4aa8-8d8e-d43bafe0e175                  |
|                                      |         | b487d80b-9356-4855-b57b-9fbf9bf13503                  |
| 0cd5eef9-523e-48cd-8a95-5dbc39bc1aa2 | net04   | eff99d5a-c2ce-4ca2-89fb-eb23718f686a 172.16.0.0/24    |
| 44ead515-da4b-443b-85cc-a5d13e06ddc8 | mynet05 | 14466141-3a5e-4355-b75f-a3c957abe9a3 192.168.111.0/24 |
+--------------------------------------+---------+-------------------------------------------------------+

Is this incompatible with floating pools?

$ ./bin/docker-machine-Darwin-x86_64 --debug create \
> --driver openstack \
> --openstack-image-id 98011e9a-fc46-45b6-ab2c-cf6c43263a22 \
> --openstack-flavor-id 3 \
> --openstack-floatingip-pool public \
> --openstack-net-id 44ead515-da4b-443b-85cc-a5d13e06ddc85 \
> --openstack-sec-groups machine \
> --openstack-ssh-user ubuntu \
> u1
Docker Machine Version:  0.6.0-dev, build 
...
Error setting machine configuration from flags provided: Either Network names or Network ids must be specified, not both

With openstack-net-id ID I can't make it work while it goes smoothly with openstack-net-name mynet05:

 ./bin/docker-machine-Darwin-x86_64 --debug create \
> --driver openstack \
> --openstack-image-id 98011e9a-fc46-45b6-ab2c-cf6c43263a22 \
> --openstack-flavor-id 3 \
> --openstack-net-id 44ead515-da4b-443b-85cc-a5d13e06ddc85 \
> --openstack-sec-groups machine \
> --openstack-ssh-user ubuntu \
> u1
Docker Machine Version:  0.6.0-dev, build
...
Error setting machine configuration from flags provided: Either Network name or Network id must be specified, not both
$ ./bin/docker-machine-Darwin-x86_64 --debug create \
> --driver openstack \
> --openstack-image-id 98011e9a-fc46-45b6-ab2c-cf6c43263a22 \
> --openstack-flavor-id 3 \
> --openstack-net-name mynet05 \
> --openstack-sec-groups machine \
> --openstack-ssh-user ubuntu \
> u1
Docker Machine Version:  0.6.0-dev, build 
...
Creating machine...
(u1) Calling .Create
(u1) DBG | Authenticating... map[AuthUrl:http://172.18.184.20:5000/v2.0 Insecure:true DomainID: DomainName: Username:fsoppelsa TenantName:fsoppelsa TenantID:f6659e8899e24eeaa717c8f8fbbe0e50]
(u1) DBG | Found network id using its name map[Name:mynet05 ID:44ead515-da4b-443b-85cc-a5d13e06ddc8]
(u1) DBG | Found floating IP pool id using its name map[Name:public ID:095f43ed-65ba-48ce-8185-d4080e430a88]
(u1) DBG | Creating Key Pair... map[Name:u1-a6dfb9dd0729523b1eb28caf0037c16518c494f4e2e5435a91602db4cdc50b12]
(u1) DBG | Creating OpenStack instance... map[FlavorId:3 ImageId:98011e9a-fc46-45b6-ab2c-cf6c43263a22]
(u1) Creating machine...

Multiple networks separated by comma:

$ ./bin/docker-machine-Darwin-x86_64 --debug create \
> --driver openstack \
> --openstack-image-id 98011e9a-fc46-45b6-ab2c-cf6c43263a22 \
> --openstack-flavor-id 3 \
> --openstack-net-id 44ead515-da4b-443b-85cc-a5d13e06ddc85,0cd5eef9-523e-48cd-8a95-5dbc39bc1aa2 \
> --openstack-sec-groups machine \
> --openstack-ssh-user ubuntu \
> u1
Docker Machine Version:  0.6.0-dev, build 
...
Error setting machine configuration from flags provided: Either Network names or Network ids must be specified, not both

Signed-off-by: Robert Jones <robert@justjones.org>
@robertjustjones
Copy link
Contributor Author

Please see the related comments in #1444.

@fsoppelsa
Copy link
Contributor

Yes this is GO for me (for drivers/openstack).

@nathanleclaire
Copy link
Contributor

LGTM thanks all

nathanleclaire added a commit that referenced this pull request Feb 26, 2016
Rackspace/Openstack - Add/enhance --*-net-* create switches.
@nathanleclaire nathanleclaire merged commit 499cd9f into docker:master Feb 26, 2016
@dgageot
Copy link
Member

dgageot commented Feb 26, 2016

@robertjustjones, @nathanleclaire, @fsoppelsa Did you test the compatibility with previously created machines? As I said to @robertjustjones, changing field names/types in Driver struct can have random effects.

@fsoppelsa
Copy link
Contributor

@dgageot I just tried to remove an old machine created with 0.5.2 and it worked. How could this new feature (adding more networks in creation) impact old machines?

@robertjustjones
Copy link
Contributor Author

@dgageot I see now what you're referring to. I thought only the switches were public, but I see now that filestore.go is json-ifying the Driver. I'll see if I can break it. LMK if you suspect a particular sequence that might fail.

@nathanleclaire
Copy link
Contributor

Ah, @dgageot is right -- My fault, I think we will need to revert this PR and revisit the changes to the Driver struct. In its current form it will break existing machines.

The main problematic bit is changing the name and type of NetworkNames and NetworkIds fields. When the client goes to send over the existing JSON to this new driver, the payload will deliver a NetworkName and NetworkId field which don't have any analogue in the new driver. Consequently that information will be lost and any operations which rely on these fields will fail.

@nathanleclaire
Copy link
Contributor

We should probably have automated tests that break when changing values in the Driver structs, but I'm not sure how that would be possible.

@nathanleclaire
Copy link
Contributor

Alright, here's the plan:

  • I'm going to revert this commit in master
  • @robertjustjones I ask that you please open a new PR and we'll figure out how to integrate these changes in a non-breaking way.

Thanks!

@robertjustjones
Copy link
Contributor Author

Sounds good @nathanleclaire. Thanks.

@rvion
Copy link

rvion commented Sep 5, 2016

Does anyone knows the state of this ?

Is it now possible to create an OpenStack machine with either multiple --openstack-net-id switches or one --openstack-net-id param with coma-separated list of networks ?

thanks :)

@fsoppelsa
Copy link
Contributor

@robertjustjones did you open a new PR?

@FlorianLudwig
Copy link
Contributor

@robertjustjones I guess this PR is dead?

@sagar-chandarana
Copy link

is this functional?

Currently I am getting an error. No interface found with name 'vlan,Ext-Net'

docker-machine v0.13.0, build 9ba6da9.
driver/hosts: Openstack Nova on OVH

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants