Skip to content
This repository has been archived by the owner on Mar 6, 2019. It is now read-only.

Issue with network_id returning instead of subnet id #44

Closed
mattbarrio opened this issue Mar 7, 2017 · 4 comments
Closed

Issue with network_id returning instead of subnet id #44

mattbarrio opened this issue Mar 7, 2017 · 4 comments

Comments

@mattbarrio
Copy link
Contributor

mattbarrio commented Mar 7, 2017

ISSUE
When creating/describing a subnet the id that is returned is the network_id and not the id of the actual subnet.

STEPS TO REPRODUCE

  1. create subnet via otc client

root# otc ecs create-subnet --subnet-name ${ENV_NAME}-01 --cidr ${SUBNET_1_CIDR_BLOCK} --gateway-ip ${SUBNET_1_GATEWAY_IP} --primary-dns ${PRIMARY_DNS} --secondary-dns ${SECONDARY_DNS} --availability-zone eu-de-01 --vpc-name ${ENV_NAME}-vpc

>{"subnet":{"id":"4907224f-c12c-45bd-9f9a-18c99ec20a26","name":"ol-staging-01","cidr":"192.168.1.0/24","status":"UNKNOWN","vpc_id":"2c24c98d-7970-4506-b627-812c13ae8521","gateway_ip":"192.168.1.1","dhcp_enable":true,"primary_dns":"100.125.4.25","secondary_dns":"8.8.8.8","availability_zone":"eu-de-01"}}

root# otc ecs describe-subnets
>| status | name | availability_zone | primary_dns | gateway_ip | vpc_id | cidr | id | ACTIVE | ol-staging-01 | eu-de-01 | 100.125.4.25 | 192.168.1.1 | 2c24c98d-7970-4506-b627-812c13ae8521 | 192.168.1.0/24 | 4907224f-c12c-45bd-9f9a-18c99ec20a26 |

  1. Checking this via the openstack cli the correct id and network id are returned

root# openstack subnet list
>| ID | Name | Network | Subnet | | 2e580847-e14e-4f8b-bdfd-e1fde65dda97 | ol-staging-01 | 4907224f-c12c-45bd-9f9a-18c99ec20a26 | 192.168.1.0/24 |

When sending delete to the endpoint with the network id this fails, 1) because there is a port attached to the subnet (seems to be the gateway_ip?) 2) because there is no subnet with the id of network id.

Anywork around with the native openstack client or thoughts about fixes on the otc client? I tried to delete the port via openstack cli but ended with error because of the device-owner=network:dhcp and didn't want to orphan any objects by removing that.

@hodigy
Copy link
Contributor

hodigy commented Apr 14, 2017

OTC Api reference contains the API call that otc client uses in chapter 4.3:
GET /v1/{tenant_id}/subnets
https://docs.otc.t-systems.com/en-us/vpc_dld/index.html
I'm checking openstack client for it's call details.

@hodigy
Copy link
Contributor

hodigy commented Apr 14, 2017

openstack client uses another api version.
curl -g -i -X GET https://vpc.eu-de.otctest.t-systems.com/v2.0/subnets

@hodigy
Copy link
Contributor

hodigy commented Apr 14, 2017

There were problems with the otc delete-subnet command, that has been fixed in pull request #50

Please note that VPC is mandatory parameter of the delete.

Is there additional issues or that was it?

@zsoltn
Copy link
Collaborator

zsoltn commented Apr 18, 2017

Fixed with f57118c.

@zsoltn zsoltn closed this as completed Apr 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants