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

Use static boot config params to acquire IP address, net mask and GW for xen unikernel #228

Closed
julianchesterfield opened this Issue Feb 26, 2014 · 6 comments

Comments

Projects
None yet
3 participants
@julianchesterfield

julianchesterfield commented Feb 26, 2014

Following discussion during project meeting, we need a way to bootstrap a unikernel with a static assigned IP address from the xen config. There are some parameters that may be usable:

ip=x.x.x.x
netmask=255.x.x.x
gateway=x.x.x.x

also the vif=[] parameter allows assignment of IP address in the form:

vif=['bridge=br0,vifname=974f799d,mac=DE:AD:BE:EF:02:12,ip=10.200.2.12']

Longterm we should consider supporting Cloudinit to bootstrap VM info including passwords and ssh keys etc..

With the parameters provided above the cmdline variable in xenstore is populated as:

[root@192.168.1.20 tmp]# xenstore-read /vm/73f7b83b-61df-a521-0891-9b948acc5812/image/cmdline
ip=10.200.2.10:127.0.255.255:10.200.2.254:255.255.255.0::eth0:off

First approach to get things working is to grab the xenstore key at the start point and extract IP info if it is provided.

@avsm

This comment has been minimized.

Member

avsm commented Mar 4, 2014

Confirmed that this doesn't work with XL, since it ignores the ip/netmask/gateway keys.

@avsm

This comment has been minimized.

Member

avsm commented Mar 4, 2014

XL also doesn't update /vm/<uuid>/image/cmdline -- it's always blank.

However, by using the extra= key, the string is in the start_info page

@julianchesterfield

This comment has been minimized.

julianchesterfield commented Mar 4, 2014

Agreed, the 'extra' parameter should always work with all toolstacks. What format do you propose to pass in? Same as the kernel boot net info format such as:

ip=10.200.2.10:127.0.255.255:10.200.2.254:255.255.255.0::eth0:off

avsm added a commit to avsm/mirage-skeleton that referenced this issue Mar 4, 2014

Add a custom xen-only static website to demonstrate kernel command li…
…ne parsing

This is temporary until libraries are adapted. See mirage/mirage#228 for more info.
@avsm

This comment has been minimized.

Member

avsm commented Mar 4, 2014

I made it simpler, so you can just add explicit ip/gateway/netmask entries. See:
https://github.com/mirage/mirage-skeleton/blob/master/xen/static_website%2Bip/README.md

Could you please try this out and see if it works for you? I explicitly built it out of Netif functors to control the IP assignment, and can fold it into the libraries later if this example works. Just cd xen/static_website+ip, and build it like the static website (contents in htdocs).

@samoht

This comment has been minimized.

Member

samoht commented Mar 17, 2015

Should be improved by #360 (once completed)

@samoht samoht added this to the mirage 2.7.0 milestone Oct 31, 2015

@samoht

This comment has been minimized.

Member

samoht commented Oct 31, 2015

This is now done.

@samoht samoht closed this Oct 31, 2015

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