Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user-v2: make IP addresses deterministic #1785

Closed
AkihiroSuda opened this issue Sep 11, 2023 · 8 comments · Fixed by #1801
Closed

user-v2: make IP addresses deterministic #1785

AkihiroSuda opened this issue Sep 11, 2023 · 8 comments · Fixed by #1801

Comments

@AkihiroSuda
Copy link
Member

#1181 (reply in thread)

@AkihiroSuda
Copy link
Member Author

This seems needed to keep the VM sshable after running sudo reboot in the VM

cc @balajiv113

@balajiv113
Copy link
Member

@AkihiroSuda With a normal reboot from vm it still works without issues.

Are you talking about any race condition ??

@AkihiroSuda
Copy link
Member Author

@AkihiroSuda With a normal reboot from vm it still works without issues.

Are you talking about any race condition ??

Yes, seems a race. Just observed an unsshable reboot once.
Maybe not an issue of user-v2.

(Deterministic IP is still desired for multi-node Kube though)

@louhisuo
Copy link

Just question, are you considering Deterministic IPs also for Sharednetwork, or only user-v2network?

@AkihiroSuda
Copy link
Member Author

AkihiroSuda commented Sep 15, 2023

Just question, are you considering Deterministic IPs also for Sharednetwork, or only user-v2network?

For shared network the IP is decided by Apple's bootpd (via vmnet.framework), not by Lima.
See here for deterministic IP with vmnet.framework: https://github.com/lima-vm/socket_vmnet/tree/v1.1.2#how-to-reserve-dhcp-addresses

@louhisuo
Copy link

Understood, thanks for clarification. Now I understand why you focus user-v2network. Even Host-VM communication will not be possible with user-v2network, getting support deterministic IP will be a big improvement so big thanks to considering to adding it.

With Shared network i will try out method proposed by above link and if needed will follow-up that topic under discussions

@balajiv113
Copy link
Member

An approach for implementing this, i was thinking of serializing the leases to a json file on stop of user-v2 and on startup of user-v2 daemon we could pass through the same for static leases.

This way we will get deterministic ip as long as mac address stays the same. This requires zero changes from gvisor-tap-vsock as well

@AkihiroSuda
Copy link
Member Author

An approach for implementing this, i was thinking of serializing the leases to a json file on stop of user-v2 and on startup of user-v2 daemon we could pass through the same for static leases.

This way we will get deterministic ip as long as mac address stays the same. This requires zero changes from gvisor-tap-vsock as well

SGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants