{"action":"created","issue":{"url":"https://api.github.com/repos/fog/fog-google/issues/166","repository_url":"https://api.github.com/repos/fog/fog-google","labels_url":"https://api.github.com/repos/fog/fog-google/issues/166/labels{/name}","comments_url":"https://api.github.com/repos/fog/fog-google/issues/166/comments","events_url":"https://api.github.com/repos/fog/fog-google/issues/166/events","html_url":"https://github.com/fog/fog-google/issues/166","id":183753367,"number":166,"title":"set_disk_auto_delete issue","user":{"login":"idan89","id":6001184,"avatar_url":"https://avatars.githubusercontent.com/u/6001184?v=3","gravatar_id":"","url":"https://api.github.com/users/idan89","html_url":"https://github.com/idan89","followers_url":"https://api.github.com/users/idan89/followers","following_url":"https://api.github.com/users/idan89/following{/other_user}","gists_url":"https://api.github.com/users/idan89/gists{/gist_id}","starred_url":"https://api.github.com/users/idan89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idan89/subscriptions","organizations_url":"https://api.github.com/users/idan89/orgs","repos_url":"https://api.github.com/users/idan89/repos","events_url":"https://api.github.com/users/idan89/events{/privacy}","received_events_url":"https://api.github.com/users/idan89/received_events","type":"User","site_admin":false},"labels":[{"id":165817797,"url":"https://api.github.com/repos/fog/fog-google/labels/bug","name":"bug","color":"fc2929","default":true},{"id":381046252,"url":"https://api.github.com/repos/fog/fog-google/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-18T17:33:11Z","updated_at":"2016-11-05T16:59:48Z","closed_at":null,"body":"Hey there!\nAfter creating a new server, I want to set the disk to auto delete when deleting the server in the future.\nI saw that there is a function set_disk_auto_delete(auto_delete, device_name)\n\nThis is what Im doing:\n\n```\n...\nrandom = SecureRandom.hex(6)\nname = \"server-id-#{random}\"\n\ndisk = connection.disks.create(\n  :name => name,\n  :size_gb => 30,\n  :zone_name => \"us-central1-b\",\n  :source_image => \"custom-image\")\n\ndisk.wait_for { disk.ready? }\n\nserver = connection.servers.create(\n  :name => name,\n  :disks => [disk],\n  :machine_type => \"g1-small\",\n  :zone_name => \"us-central1-b\",\n  :can_ip_forward => true)\n\n# Wait_for routine copied here to show errors, if necessary.\nduration = 0\ninterval = 10\ntimeout = 600\nstart = Time.now\nuntil server.ready? || duration > timeout\n  puts \" ----- \"\n\n  server.reload\n\n  puts \"ready?: #{server.ready?}\"\n  puts \"public_ip_address: #{server.public_ip_address.inspect}\"\n\n  sleep(interval.to_f)\n  duration = Time.now - start\nend\n\nserver.set_disk_auto_delete(true,name);\n```\n\nAnd the result is:\n\n```\n----- \nready?: false\npublic_ip_address: nil\n----- \nready?: true\npublic_ip_address: \"PUBLIC_IP\"\n/path/lib/fog/google/shared.rb:183:in `build_excon_response': No attached disk found with device name 'server-id-47e428b15f89' (Fog::Errors::Error)\n    from /path/lib/fog/google/shared.rb:154:in `request'\n    from /path/lib/fog/compute/google/requests/get_zone_operation.rb:48:in `get_zone_operation'\n    from /path/lib/fog/compute/google/models/operations.rb:20:in `get'\n    from /path/lib/fog/compute/google/models/server.rb:169:in `set_disk_auto_delete'\n    from tasks/create_instance.rb:57:in `<main>'\n```\n\nIm using the name of the server/disk that I created as the device_name.\n\nI have found that the server has the following deviceName: \"deviceName\"=>\"persistent-disk-0\"\nHow can I set a different deviceName for the disk?\n\nThank you!\n"},"comment":{"url":"https://api.github.com/repos/fog/fog-google/issues/comments/258624523","html_url":"https://github.com/fog/fog-google/issues/166#issuecomment-258624523","issue_url":"https://api.github.com/repos/fog/fog-google/issues/166","id":258624523,"user":{"login":"icco","id":20201,"avatar_url":"https://avatars.githubusercontent.com/u/20201?v=3","gravatar_id":"","url":"https://api.github.com/users/icco","html_url":"https://github.com/icco","followers_url":"https://api.github.com/users/icco/followers","following_url":"https://api.github.com/users/icco/following{/other_user}","gists_url":"https://api.github.com/users/icco/gists{/gist_id}","starred_url":"https://api.github.com/users/icco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icco/subscriptions","organizations_url":"https://api.github.com/users/icco/orgs","repos_url":"https://api.github.com/users/icco/repos","events_url":"https://api.github.com/users/icco/events{/privacy}","received_events_url":"https://api.github.com/users/icco/received_events","type":"User","site_admin":false},"created_at":"2016-11-05T16:59:48Z","updated_at":"2016-11-05T16:59:48Z","body":"Oh that's super weird. Thanks for tracking down @Temikus "}}
{"actor":{"display_login":"icco"}}