sapcc / elektra

An opinionated openstack Web UI for consumer self service and operations.
Apache License 2.0
74 stars 28 forks source link

lbaas2: backup members are created with admin_state_up=false #791

Closed notandy closed 3 years ago

notandy commented 3 years ago

they should be admin_state_up enabled as it's the case with normal members

ArtieReus commented 3 years ago

backup members are created as designed. When creating the member we get admin_state_up=true. Ex:

Elektron octavia (qa-de-1/public):
-> POST https://<hidden>/v2.0/lbaas/pools/4f88cffe-8c92-4bbe-91ed-de6ce811b8c3/members
-> headers: {"X-Auth-Token"=>"<hidden>"}
-> body: {:member=>{"name"=>"backup_member", "address"=>"10.180.131.201", "protocol_port"=>"7777", "weight"=>"1", "project_id"=>"e9141fb24eee4b3e9f25ae69cda31132", "subnet_id"=>"0e1e5315-5b18-4af7-a63f-6369aadfbc19", "tags"=>["backup_member"], "backup"=>"true"}}
<- Net::HTTPCreated
<- body:  {"member"=>{"monitor_port"=>nil, "project_id"=>"e9141fb24eee4b3e9f25ae69cda31132", "name"=>"backup_member", "weight"=>1, "admin_state_up"=>true, "subnet_id"=>"0e1e5315-5b18-4af7-a63f-6369aadfbc19", "tenant_id"=>"e9141fb24eee4b3e9f25ae69cda31132", "created_at"=>"2020-11-27T08:21:00", "provisioning_status"=>"PENDING_CREATE", "monitor_address"=>nil, "updated_at"=>nil, "tags"=>["backup_member"], "address"=>"10.180.131.201", "protocol_port"=>7777, "backup"=>true, "id"=>"24bcb781-8cd2-4c12-9050-2b5915452112", "operating_status"=>"OFFLINE"}}

The problem seems to be the update. When sending a nil attribute in that case admin_state_up it is interpreted as false, see example:

Elektron octavia (qa-de-1/public):
-> PUT https://<hidden>/v2.0/lbaas/pools/4f88cffe-8c92-4bbe-91ed-de6ce811b8c3/members/24bcb781-8cd2-4c12-9050-2b5915452112
-> headers: {"X-Auth-Token"=>"<hidden>"}
-> body: {:member=>{"name"=>"backup_member", "admin_state_up"=>nil, "weight"=>"1", "tags"=>["backup_member", "test"], "backup"=>"true"}}
<- Net::HTTPOK
<- body:  {"member"=>{"monitor_port"=>nil, "project_id"=>"e9141fb24eee4b3e9f25ae69cda31132", "name"=>"backup_member", "weight"=>1, "admin_state_up"=>false, "subnet_id"=>"0e1e5315-5b18-4af7-a63f-6369aadfbc19", "tenant_id"=>"e9141fb24eee4b3e9f25ae69cda31132", "created_at"=>"2020-11-27T08:21:00", "provisioning_status"=>"PENDING_UPDATE", "monitor_address"=>nil, "updated_at"=>"2020-11-27T08:24:02", "tags"=>["backup_member", "test"], "address"=>"10.180.131.201", "protocol_port"=>7777, "backup"=>true, "id"=>"24bcb781-8cd2-4c12-9050-2b5915452112", "operating_status"=>"ERROR"}}

I will check why the update object has no attribute admin_state_up set. When this attribute is forward this should not happen again.