ops icon indicating copy to clipboard operation
ops copied to clipboard

Can not ping or curl vsphere instance

Open podman2020 opened this issue 3 years ago • 8 comments

I have went through steps to test image on vsphere, everything worked as per document, however I can not ping or curl IP. How do we configure network on vsphere instance . Added name server in config.Json

Ops create image -c config.json -t vsphere -a gtest >>> it created Ops instance create -t vsphere -i gtest >> configured Ops instance start gtest-t vsphere >> running instance and got IP.

But can not ping or curl .

podman2020 avatar Sep 22 '20 22:09 podman2020

if you are seeing an ip that means the guest ip hack would've worked - can you see anything in the vsphere console && || does the log command work for you ops instance logs -t vsphere gtest ?

eyberg avatar Sep 22 '20 22:09 eyberg

Logs is not working , it is giving please specify a datacenter, file doesn’t exist.

Guest ip hack is not enabled , hope it is not mandatory.

podman2020 avatar Sep 23 '20 21:09 podman2020

if you look at the console (inside vsphere) you should see a 'assigned a.b.c.d' - if not then it prob. isn't even booting

the datacenter def. needs to be set appropriately,

it can be set via GOVC_DATACENTER or inherited and/or set through GOVC_RESOURCE_POOL

that's definitely used for a few diff. methods (including logs) - most of this is just a wrapper around https://github.com/vmware/govmomi/tree/master/govc so if govc works then this should, govc has extensive logging/debugging output that can be toggled but it's kinda hard to grok if you don't know what you are looking for

iirc, if the guest ip setting is not enabled you'll need to access it from w/inside , but if you're seeing an ip in 'instances list' then you are already good

feel free to reach out on drift @ nanovms.com for non-public/(sensitive) help

eyberg avatar Sep 23 '20 21:09 eyberg

Yes I can see assigned IP and instance list .

Main issue is I can not ping and curl the IP. I m thinking we need to set net mask and gate way as part of config.Jason

podman2020 avatar Sep 23 '20 22:09 podman2020

if it's being assigned an ip it's using dhcp just fine - you can try spinning up a debian instance or something in the same subnet to verify it's fine w/in - but if you are still seeing an error msg about please specify a datacenter you'll need to set the approprivate env vars via GOVC_DATACENTER || GOVC_RESOURCE_POOL

eyberg avatar Sep 23 '20 22:09 eyberg

I have already set those two env variables that is why I can create an image and start instance . I have other Vms in same subnet and they are fine .

podman2020 avatar Sep 23 '20 23:09 podman2020

I think it’s problem with dhcp I m getting ips from wrong subnet.it’s same for other rhel instance ..

It would be great if we can set static up and other network settings . Please let me know if possible

Thanks for your quick responses.

podman2020 avatar Sep 24 '20 02:09 podman2020

sorry to clarify your vm is in the same subnet as the rhel instance or not? if it is it should be pingable but if it's outside you might not be able to reach it

nanos itself supports static ip although the vsphere integration only supports dhcp right now, idk if that will fix your problem though, right now ops just places the new vm into the 'default' network which i think might be what you are running into

maybe you can check the value of

GOVC_NETWORK

?

if it isn't set it defaults to this ->

	v.network = v.datacenter + "network/VM Network"
```	

regardless i opened up  https://github.com/nanovms/ops/issues/665 to allow static ip configuration

eyberg avatar Oct 05 '20 16:10 eyberg