rackerlabs / mimic

An API mock service
Other
168 stars 57 forks source link

Replicate Nova behavior regarding network validation of RackConnect enabled accounts #152

Open kivattik opened 9 years ago

kivattik commented 9 years ago

Currently, Mimic's behavior does not match that of RackConnect. When adding a node to a load balancer pool, a cloud network associated with RackConnect is required, and if not present the add request fails. Mimic does not perform any validation, so actions that are expected in production succeed running against Mimic.

cyli commented 9 years ago

After checking with the RCv3 team, I'm not sure this can happen. A server that is not on one of the RackConnect networks cannot even be created. Nova fails with:

So I don't think a server can even be created that does not have the right networks. If a non-existant server gets added, though, RackConnect does return with a 409:

{
    "errors": [
        "Cloud Server b69a3f62-d4d6-4380-9c15-7d5f32ab5c18 does not exist"
    ]
}

And all RackConnect load balancers are on all RackConnect networks.

I suppose it's possible for a server to be created, and then the cloud network it's attached to gets deleted later, but there is no API to do this (I guess someone has to do it manually), so I think we probably don't have to cover this case.

But the Nova plugin should probably support the above behavior. Going to change the title of this issue to reflect that, although I'm not changing the description.

cyli commented 9 years ago

The RCv3 team confirms that, in an account in a region where the tenant has RCv3, al cloud servers created in that region are RackConnect cloud server and are subject to the above limitations.

Such a tenant has RackConnect v3 appear in their service catalog, and the account's auth roles will have roles that look like rackconnect:v3-{region}.

cyli commented 9 years ago

One way to simulate this without all-the-way implementing cloud networks is that when the RackConnect V3 control plane is implemented, it should add RCv3 support to a tenant by enabling RCv3 to show up as an endpoint in the service catalog, and creating an RCv3 load balancer by default.

The loadbalancer should also have a network UUID associated with it (that will only appear on the RCv3 control plane since cloud networks is not implemented).

The RCv3 control plane can add a behavior to the nova control plane so that any server created has a network criteria that requires that at least one RCv3 network be added to the server.