{"action":"created","issue":{"url":"https://api.github.com/repos/axsh/wakame-vdc/issues/539","labels_url":"https://api.github.com/repos/axsh/wakame-vdc/issues/539/labels{/name}","comments_url":"https://api.github.com/repos/axsh/wakame-vdc/issues/539/comments","events_url":"https://api.github.com/repos/axsh/wakame-vdc/issues/539/events","html_url":"https://github.com/axsh/wakame-vdc/issues/539","id":67071328,"number":539,"title":"API: deleted load_balancer is not set `deleted_at`","user":{"login":"hansode","id":76867,"avatar_url":"https://avatars.githubusercontent.com/u/76867?v=3","gravatar_id":"","url":"https://api.github.com/users/hansode","html_url":"https://github.com/hansode","followers_url":"https://api.github.com/users/hansode/followers","following_url":"https://api.github.com/users/hansode/following{/other_user}","gists_url":"https://api.github.com/users/hansode/gists{/gist_id}","starred_url":"https://api.github.com/users/hansode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hansode/subscriptions","organizations_url":"https://api.github.com/users/hansode/orgs","repos_url":"https://api.github.com/users/hansode/repos","events_url":"https://api.github.com/users/hansode/events{/privacy}","received_events_url":"https://api.github.com/users/hansode/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/axsh/wakame-vdc/labels/Type%20:%20Bug","name":"Type : Bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-08T07:49:56Z","updated_at":"2015-04-16T06:18:53Z","closed_at":null,"body":"### Problem\r\n\r\nA deleted load_balancer is not set `deleted_at` like this:\r\n\r\n```\r\n$ mussel.sh load_balancer show lb-b7l6v95y\r\n---\r\n:id: lb-b7l6v95y\r\n:uuid: lb-b7l6v95y\r\n:account_id: a-shpoolxx\r\n:instance_id: i-8yx2fgcx\r\n:instance_protocol: http\r\n:instance_port: 80\r\n:balance_algorithm: leastconn\r\n:cookie_name:\r\n:description: ''\r\n:private_key: ''\r\n:public_key: ''\r\n:created_at: 2015-04-08 07:30:43.000000000 Z\r\n:updated_at: 2015-04-08 07:30:43.000000000 Z\r\n:deleted_at:\r\n:display_name:\r\n:allow_list:\r\n- 0.0.0.0\r\n:httpchk_path: ''\r\n:state: terminated\r\n:status: offline\r\n:target_vifs: []\r\n:vif:\r\n- :vif_id: vif-oo7rnl3j\r\n  :vif_index: 0\r\n  :network_id: nw-demo1\r\n- :vif_id: vif-59ai9zno\r\n  :vif_index: 1\r\n  :network_id: nw-demo8\r\n:inbounds:\r\n- :port: 80\r\n  :protocol: http\r\n```\r\n\r\nTherefore listing alive loadbalancer responds bad document.\r\n\r\n```\r\n$ mussel.sh load_balancer index --state alive\r\n---\r\n- :total: 2\r\n  :start: 0\r\n  :limit: 250\r\n  :results:\r\n  - :id: lb-b7l6v95y\r\n    :uuid: lb-b7l6v95y\r\n    :account_id: a-shpoolxx\r\n    :instance_id: i-8yx2fgcx\r\n    :instance_protocol: http\r\n    :instance_port: 80\r\n    :balance_algorithm: leastconn\r\n    :cookie_name:\r\n    :description: ''\r\n    :private_key: ''\r\n    :public_key: ''\r\n    :created_at: 2015-04-08 07:30:43.000000000 Z\r\n    :updated_at: 2015-04-08 07:30:43.000000000 Z\r\n    :deleted_at:\r\n    :display_name:\r\n    :allow_list:\r\n    - 0.0.0.0\r\n    :httpchk_path: ''\r\n    :state: terminated\r\n    :status: offline\r\n    :target_vifs: []\r\n    :vif:\r\n    - :vif_id: vif-oo7rnl3j\r\n      :vif_index: 0\r\n      :network_id: nw-demo1\r\n    - :vif_id: vif-59ai9zno\r\n      :vif_index: 1\r\n      :network_id: nw-demo8\r\n    :inbounds:\r\n    - :port: 80\r\n      :protocol: http\r\n  - :id: lb-z3261dc9\r\n    :uuid: lb-z3261dc9\r\n    :account_id: a-shpoolxx\r\n    :instance_id: i-mslqyv0i\r\n    :instance_protocol: http\r\n    :instance_port: 80\r\n    :balance_algorithm: leastconn\r\n    :cookie_name:\r\n    :description: ''\r\n    :private_key: ''\r\n    :public_key: ''\r\n    :created_at: 2015-04-08 07:12:31.000000000 Z\r\n    :updated_at: 2015-04-08 07:12:31.000000000 Z\r\n    :deleted_at:\r\n    :display_name:\r\n    :allow_list:\r\n    - 0.0.0.0\r\n    :httpchk_path: ''\r\n    :state: terminated\r\n    :status: offline\r\n    :target_vifs: []\r\n    :vif:\r\n    - :vif_id: vif-yu39lp8o\r\n      :vif_index: 0\r\n      :network_id: nw-demo1\r\n    - :vif_id: vif-h9lzads6\r\n      :vif_index: 1\r\n      :network_id: nw-demo8\r\n    :inbounds:\r\n    - :port: 80\r\n      :protocol: http\r\n```\r\n\r\n#### Steps to reprodoce:\r\n\r\n1. Create a load_balancer with mussel\r\n2. Delete the load_balancer with mussel\r\n3. Show the load_balancer with mussel\r\n\r\n```\r\n$ mussel.sh load_balancer create --balance-algorithm leastconn --engine haproxy --instance-port 80 --instance-protocol http --max-connection 1000 --port 80 --protocol http\r\n$ mussel.sh load_balancer destroy <lb-***>\r\n$ mussel.sh load_balancer show <lb-***>\r\n```\r\n\r\n### Possible soludion\r\n\r\nno idea.\r\n\r\nhttps://github.com/axsh/wakame-vdc/blob/master/dcmgr/lib/dcmgr/models/load_balancer.rb#L224-L227 related?\r\n\r\n```\r\n    def delete\r\n      self.deleted_at ||= Time.now\r\n      self.save_changes\r\n    end\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/axsh/wakame-vdc/issues/comments/93653490","html_url":"https://github.com/axsh/wakame-vdc/issues/539#issuecomment-93653490","issue_url":"https://api.github.com/repos/axsh/wakame-vdc/issues/539","id":93653490,"user":{"login":"hansode","id":76867,"avatar_url":"https://avatars.githubusercontent.com/u/76867?v=3","gravatar_id":"","url":"https://api.github.com/users/hansode","html_url":"https://github.com/hansode","followers_url":"https://api.github.com/users/hansode/followers","following_url":"https://api.github.com/users/hansode/following{/other_user}","gists_url":"https://api.github.com/users/hansode/gists{/gist_id}","starred_url":"https://api.github.com/users/hansode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hansode/subscriptions","organizations_url":"https://api.github.com/users/hansode/orgs","repos_url":"https://api.github.com/users/hansode/repos","events_url":"https://api.github.com/users/hansode/events{/privacy}","received_events_url":"https://api.github.com/users/hansode/received_events","type":"User","site_admin":false},"created_at":"2015-04-16T06:18:53Z","updated_at":"2015-04-16T06:18:53Z","body":"This caused my miss-configuration.\r\n\r\nI set `service-type` of `lb-haproxy64` to `std`. It should be `lb`.\r\n\r\nbad configuration:\r\n\r\n```\r\n$ mussel.sh image show wmi-haproxy1d64\r\n---\r\n:id: wmi-haproxy1d64\r\n:account_id: a-shpoolxx\r\n:uuid: wmi-haproxy1d64\r\n:created_at: 2015-04-14 11:29:51.000000000 Z\r\n:updated_at: 2015-04-14 11:29:51.000000000 Z\r\n:boot_dev_type: 2\r\n:arch: x86_64\r\n:description: lb-centos6.6-stud.x86_64.openvz.md.raw.tar.gz local\r\n:is_public: true\r\n:state: available\r\n:features:\r\n  :virtio: true\r\n:file_format: raw\r\n:root_device: label:root\r\n:is_cacheable: true\r\n:instance_model_name: ''\r\n:parent_image_id:\r\n:service_type: std\r\n:display_name: haproxy1d64\r\n:backup_object_id: bo-haproxy1d64\r\n:deleted_at:\r\n:volumes: []\r\n:vifs: []\r\n:os_type: linux\r\n:labels: []\r\n```\r\n"}}