{"action":"created","issue":{"url":"https://api.github.com/repos/vmware/vic/issues/3210","repository_url":"https://api.github.com/repos/vmware/vic","labels_url":"https://api.github.com/repos/vmware/vic/issues/3210/labels{/name}","comments_url":"https://api.github.com/repos/vmware/vic/issues/3210/comments","events_url":"https://api.github.com/repos/vmware/vic/issues/3210/events","html_url":"https://github.com/vmware/vic/pull/3210","id":190111320,"number":3210,"title":"Connectivity diagnostic with VC/ESXi from appliance ","user":{"login":"vburenin","id":4350891,"avatar_url":"https://avatars.githubusercontent.com/u/4350891?v=3","gravatar_id":"","url":"https://api.github.com/users/vburenin","html_url":"https://github.com/vburenin","followers_url":"https://api.github.com/users/vburenin/followers","following_url":"https://api.github.com/users/vburenin/following{/other_user}","gists_url":"https://api.github.com/users/vburenin/gists{/gist_id}","starred_url":"https://api.github.com/users/vburenin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vburenin/subscriptions","organizations_url":"https://api.github.com/users/vburenin/orgs","repos_url":"https://api.github.com/users/vburenin/repos","events_url":"https://api.github.com/users/vburenin/events{/privacy}","received_events_url":"https://api.github.com/users/vburenin/received_events","type":"User","site_admin":false},"labels":[{"id":353174341,"url":"https://api.github.com/repos/vmware/vic/labels/cla-not-required","name":"cla-not-required","color":"159818","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-17T17:27:02Z","updated_at":"2016-11-17T21:20:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/vmware/vic/pulls/3210","html_url":"https://github.com/vmware/vic/pull/3210","diff_url":"https://github.com/vmware/vic/pull/3210.diff","patch_url":"https://github.com/vmware/vic/pull/3210.patch"},"body":"<!--\r\nThank you for submitting a pull request!\r\n\r\nHere's a checklist you might find useful.\r\n[  ] There is an associated issue that is labelled\r\n[  ] Code is up-to-date with the `master` branch\r\n[  ] You've successfully run `make test` locally\r\n[  ] There are new or updated unit tests validating the change\r\n\r\nRefer to CONTRIBUTING.MD for more details.\r\n  https://github.com/vmware/vic/blob/master/.github/CONTRIBUTING.md\r\n-->\r\n\r\n```\r\nINFO[2016-11-17T09:21:25-08:00] Waiting for IP information\r\nINFO[2016-11-17T09:21:31-08:00] Waiting for major appliance components to launch\r\n\r\nINFO[2016-11-17T09:21:31-08:00] Checking connectivity with the target vCenter/ESXi\r\nINFO[2016-11-17T09:21:31-08:00] VC/ESXi API Ping Test: https://10.0.1.152 is reacheable and responds to ICMP ping request\r\nINFO[2016-11-17T09:21:31-08:00] VC/ESXi API Test: https://10.0.1.152 API responds as expected\r\n\r\nINFO[2016-11-17T09:21:34-08:00] Initialization of appliance successful\r\nINFO[2016-11-17T09:21:34-08:00]\r\nINFO[2016-11-17T09:21:34-08:00] VCH Admin Portal:\r\nINFO[2016-11-17T09:21:34-08:00] https://10.0.1.156:2378\r\nINFO[2016-11-17T09:21:34-08:00]\r\nINFO[2016-11-17T09:21:34-08:00] Published ports can be reached at:\r\nINFO[2016-11-17T09:21:34-08:00] 10.0.1.156\r\nINFO[2016-11-17T09:21:34-08:00]\r\nINFO[2016-11-17T09:21:34-08:00] Docker environment variables:\r\nINFO[2016-11-17T09:21:34-08:00] DOCKER_HOST=10.0.1.156:2375\r\nINFO[2016-11-17T09:21:34-08:00]\r\nINFO[2016-11-17T09:21:34-08:00] Environment saved in vic-docker/vic-docker.env\r\nINFO[2016-11-17T09:21:34-08:00]\r\nINFO[2016-11-17T09:21:34-08:00] Connect to docker:\r\nINFO[2016-11-17T09:21:34-08:00] docker -H 10.0.1.156:2375 info\r\nINFO[2016-11-17T09:21:34-08:00] Installer completed successfully\r\n```\r\n\r\n```\r\nINFO[2016-11-17T09:19:08-08:00] Waiting for IP information\r\nINFO[2016-11-17T09:19:13-08:00] Waiting for major appliance components to launch\r\nINFO[2016-11-17T09:19:13-08:00] Checking connectivity with the target vCenter/ESXi\r\nERRO[2016-11-17T09:19:14-08:00] VC/ESXi API Ping Test: https://brokenesx is unknown host name\r\nINFO[2016-11-17T09:19:14-08:00] Collecting ha-host hostd.log\r\nERRO[2016-11-17T09:19:14-08:00] --------------------\r\nERRO[2016-11-17T09:19:14-08:00] vic-machine-linux failed: Access to VC/ESXi failed a ping test\r\n```\r\n\r\nFixes #3066\r\n"},"comment":{"url":"https://api.github.com/repos/vmware/vic/issues/comments/261372720","html_url":"https://github.com/vmware/vic/pull/3210#issuecomment-261372720","issue_url":"https://api.github.com/repos/vmware/vic/issues/3210","id":261372720,"user":{"login":"caglar10ur","id":205498,"avatar_url":"https://avatars.githubusercontent.com/u/205498?v=3","gravatar_id":"","url":"https://api.github.com/users/caglar10ur","html_url":"https://github.com/caglar10ur","followers_url":"https://api.github.com/users/caglar10ur/followers","following_url":"https://api.github.com/users/caglar10ur/following{/other_user}","gists_url":"https://api.github.com/users/caglar10ur/gists{/gist_id}","starred_url":"https://api.github.com/users/caglar10ur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caglar10ur/subscriptions","organizations_url":"https://api.github.com/users/caglar10ur/orgs","repos_url":"https://api.github.com/users/caglar10ur/repos","events_url":"https://api.github.com/users/caglar10ur/events{/privacy}","received_events_url":"https://api.github.com/users/caglar10ur/received_events","type":"User","site_admin":false},"created_at":"2016-11-17T21:20:05Z","updated_at":"2016-11-17T21:20:05Z","body":"using icmp pkg produces way less code than this diag pkg (and much easier to wortk with IMHO) so I'm still not sure why we prefer that. From that link above\r\n\r\n```\r\n// PrivilegedPing sends a ipv4.ICMPTypeEcho message to the given IP and returns true if it responds with a ipv4.ICMPTypeEchoReply\r\n// Terminates if an error occurs\r\nfunc PrivilegedPing(ip net.IP, seq int) bool {\r\n\tc, err := icmp.ListenPacket(\"ip4:icmp\", \"0.0.0.0\")\r\n\tif err != nil {\r\n\t\tGuestRPCErrorf(\"Unable to listen: %s\", err)\r\n\t\tos.Exit(ERR)\r\n\t}\r\n\tdefer c.Close()\r\n\r\n\t// craft the icmp message\r\n\twm := icmp.Message{\r\n\t\tType: ipv4.ICMPTypeEcho,\r\n\t\tCode: 0,\r\n\t\tBody: &icmp.Echo{\r\n\t\t\tID:   os.Getpid() & 0xffff,\r\n\t\t\tSeq:  1 << uint(seq),\r\n\t\t\tData: []byte(\"KNOCK-IF-YOU-CAN-HEAR-ME\"),\r\n\t\t},\r\n\t}\r\n\r\n\t// marshal it to write buffer\r\n\twb, err := wm.Marshal(nil)\r\n\tif err != nil {\r\n\t\tGuestRPCErrorf(\"Unable to marshall the icmp message: %s\", err)\r\n\t\tos.Exit(ERR)\r\n\t}\r\n\r\n\tdst := &net.IPAddr{IP: ip}\r\n\t// write it to wire\r\n\tif n, err := c.WriteTo(wb, dst); err != nil {\r\n\t\tGuestRPCErrorf(\"Unable to write: %s\", err)\r\n\t\tos.Exit(ERR)\r\n\t} else if n != len(wb) {\r\n\t\tGuestRPCErrorf(\"Unable to write: got %v; want %v\", n, len(wb))\r\n\t\tos.Exit(ERR)\r\n\t}\r\n\r\n\t// create read buffer\r\n\trb := make([]byte, 1500)\r\n\r\n\t// Set read deadling to 3 sec.\r\n\tif err := c.SetReadDeadline(time.Now().Add(3 * time.Second)); err != nil {\r\n\t\tGuestRPCErrorf(\"Unable to set deadline: %s\", err)\r\n\t\tos.Exit(ERR)\r\n\t}\r\n\r\n\t// read it from wire to read buffer\r\n\tn, _, err := c.ReadFrom(rb)\r\n\tif err != nil {\r\n\t\tGuestRPCErrorf(\"Unable to read: %s\", err)\r\n\t\tos.Exit(ERR)\r\n\t}\r\n\r\n\t// parse the icmp message\r\n\trm, err := icmp.ParseMessage(iana.ProtocolICMP, rb[:n])\r\n\tif err != nil {\r\n\t\tGuestRPCErrorf(\"Unable to parse: %s\", err)\r\n\t\tos.Exit(ERR)\r\n\t}\r\n\r\n\t// type assert to see whether we have a response\r\n\tswitch rm.Type {\r\n\tcase ipv4.ICMPTypeEchoReply:\r\n\t\treturn true\r\n\tdefault:\r\n\t\treturn false\r\n\t}\r\n}\r\n```\r\n\r\nbut I'm fine with this if others are OK with it so I'll let them to decide"}}
{"actor":{"display_login":"caglar10ur"}}