I''ve been mucking with xen for quite a while but recently started focusing on custom network setups. I''d like to be able to create VMs on the fly from a base image and set network settings in each without booting the image up. This strange setup is for a classroom environment. At the beginning of the quarter the instructor would run a script that creates all the student''s DomUs and assigns a route to them on the Dom0 from the WAN . The goal is to have a remote port (say 10001) be redirected to the students virtual machine''s port 22. Each student would access their VM using a different remote port. All of the students VMs will be copies (or using qcow2 backing file) of a base image so will be identical to save space and setup time. It seems like I had it easy by setting vif = [ ''ip=x.x.x.x'' ] but this doesn''t seem to do anything. According to Running Xen you need to statically set the ip inside the DomU as well as setting it in the domU config file. Doesn''t setting it in both places defeat the purpose of having it in the DomU config file to start with? My next thought was to set the mac address in the DomU config file and then have the client OS request an IP from a DHCP server which would IP addresses based on the mac address noted in the domU config file. The mac address assigned also doesn''t seem to do anything. Does anyone have any ideas how to accomplish this? I''m sure I could power up each VM, access it via ssh and reset the IP then power it down via script but for 30 students this will take a while. I assumed that I''d be able to differentiate between the DomUs from the Dom0 without modification of the DomU network files. TIA Grant _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Grant, I tried something similar some time ago to no avail. What I ended up doing is setting the IP in the script that I used to build the image on the fly (i.e. mount the image, add custom /etc/sysconfig/network-scripts/ifcfg-eth0 -- in RH based). Altertavitvely you could leave it on DHCP and set all of the mac addresses and then create a DHCP pool that is only allocated to those MAC addresses. In short, IP in config for me has never succeeded but fixed MAC''s have. Gary ________________________________ From: xen-users-bounces@lists.xensource.com on behalf of Grant McWilliams Sent: Thu 12/11/2008 12:36 PM To: xen-users@lists.xensource.com Subject: [Xen-users] Xen virtual interface settings I''ve been mucking with xen for quite a while but recently started focusing on custom network setups. I''d like to be able to create VMs on the fly from a base image and set network settings in each without booting the image up. This strange setup is for a classroom environment. At the beginning of the quarter the instructor would run a script that creates all the student''s DomUs and assigns a route to them on the Dom0 from the WAN . The goal is to have a remote port (say 10001) be redirected to the students virtual machine''s port 22. Each student would access their VM using a different remote port. All of the students VMs will be copies (or using qcow2 backing file) of a base image so will be identical to save space and setup time. It seems like I had it easy by setting vif = [ ''ip=x.x.x.x'' ] but this doesn''t seem to do anything. According to Running Xen you need to statically set the ip inside the DomU as well as setting it in the domU config file. Doesn''t setting it in both places defeat the purpose of having it in the DomU config file to start with? My next thought was to set the mac address in the DomU config file and then have the client OS request an IP from a DHCP server which would IP addresses based on the mac address noted in the domU config file. The mac address assigned also doesn''t seem to do anything. Does anyone have any ideas how to accomplish this? I''m sure I could power up each VM, access it via ssh and reset the IP then power it down via script but for 30 students this will take a while. I assumed that I''d be able to differentiate between the DomUs from the Dom0 without modification of the DomU network files. TIA Grant _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Am Donnerstag, den 11.12.2008, 12:38 -0800 schrieb Gary W. Smith:> Grant, > > I tried something similar some time ago to no avail. What I ended up > doing is setting the IP in the script that I used to build the image > on the fly (i.e. mount the image, add > custom /etc/sysconfig/network-scripts/ifcfg-eth0 -- in RH based). > > Altertavitvely you could leave it on DHCP and set all of the mac > addresses and then create a DHCP pool that is only allocated to > those MAC addresses. > > In short, IP in config for me has never succeeded but fixed MAC''s > have.but a combination works too, e.g. vif = [ ''mac=00:16:3E:5A:A4:A5, ip=192.168.100.1'' ] The Problem if you do _not_ set a mac-adress in domu-config, the mac-adress for this domu changes on each startup.> > Garyand to these topic: .... All of the students VMs will be copies (or using qcow2 backing file) of a base image so will be identical to save space and setup time. .... Create your "Master-Image" as LVM-Volume and give those domus a snapshot from this volume. Since lvm supports copy-on-write this is really cool, e-g- for a web-server-cluster or anything where a "golden-image" and the guests have only minor changes... . Just my 2cents Thomas _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, Dec 11, 2008 at 1:10 PM, Thomas Halinka <lists@thohal.de> wrote:> Am Donnerstag, den 11.12.2008, 12:38 -0800 schrieb Gary W. Smith: > > Grant, > > > > I tried something similar some time ago to no avail. What I ended up > > doing is setting the IP in the script that I used to build the image > > on the fly (i.e. mount the image, add > > custom /etc/sysconfig/network-scripts/ifcfg-eth0 -- in RH based). > > >I was thinking about this. I could probably losetup the image and copy the network config to it.> > > Altertavitvely you could leave it on DHCP and set all of the mac > > addresses and then create a DHCP pool that is only allocated to > > those MAC addresses. > > > > In short, IP in config for me has never succeeded but fixed MAC''s > > have. > but a combination works too, e.g. > > vif = [ ''mac=00:16:3E:5A:A4:A5, ip=192.168.100.1'' ] > > The Problem if you do _not_ set a mac-adress in domu-config, the > mac-adress for this domu changes on each startup. > > > > > Gary >I''m figuring this out. What mac are you setting by using this line then? I''m not sure what the point is. You say that fixed macs have worked. I set the mac and my dhcp server but the mac that gets sent is the one of the domU which is not the one I set in the DomU config. What IS the domU mac= or ip= lines for?> > > and to these topic: > .... All of the students VMs will be copies (or using qcow2 backing > file) of a base image so will be identical to save space and setup > time. > .... > > Create your "Master-Image" as LVM-Volume and give those domus a snapshot > from this volume. Since lvm supports copy-on-write this is really cool, > e-g- for a web-server-cluster or anything where a "golden-image" and the > guests have only minor changes... . > > Just my 2cents > > Thomas >Thomas, LVM is very expensive when you have a mass of snapshots though. LVM snapshots are great for backing up but 100 snapshots are going to be a mess. Grant _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, Dec 11, 2008 at 3:36 PM, Grant McWilliams <grantmasterflash@gmail.com> wrote:> I''ve been mucking with xen for quite a while but recently started focusing > on custom network setups. I''d like to be able to create VMs on the fly from > a base image and set network settings in each without booting the image up. > > This strange setup is for a classroom environment. At the beginning of the > quarter the instructor would run a script that creates all the student''s > DomUs and assigns a route to them on the Dom0 from the WAN . The goal is to > have a remote port (say 10001) be redirected to the students virtual > machine''s port 22. Each student would access their VM using a different > remote port. All of the students VMs will be copies (or using qcow2 backing > file) of a base image so will be identical to save space and setup time. > > It seems like I had it easy by setting vif = [ ''ip=x.x.x.x'' ] but this > doesn''t seem to do anything. According to Running Xen you need to statically > set the ip inside the DomU as well as setting it in the domU config file. > Doesn''t setting it in both places defeat the purpose of having it in the > DomU config file to start with? >An update on the website about this: http://runningxen.com/changes/ "The kernel has to be compiled with CONFIG_IP_PNP to enable the automatic network settings. Then IP, Netmask, Gateway, … will set from config-file (as long, there is no extra setting in domU''s /etc/network/interfaces for eth0) grep IP_PNP /boot/config-2.6.-xen" shows you if it is set." - xen mailing list Related (old) bug report: http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=471 I haven''t test it yet, but it is worth looking into. Hope that helps. Cheers, Todd -- Todd Deshane http://todddeshane.net http://runningxen.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Sat, Jan 3, 2009 at 12:52 PM, Todd Deshane <deshantm@gmail.com> wrote:> On Thu, Dec 11, 2008 at 3:36 PM, Grant McWilliams > <grantmasterflash@gmail.com> wrote: > > I've been mucking with xen for quite a while but recently started > focusing > > on custom network setups. I'd like to be able to create VMs on the fly > from > > a base image and set network settings in each without booting the image > up. > > > > This strange setup is for a classroom environment. At the beginning of > the > > quarter the instructor would run a script that creates all the student's > > DomUs and assigns a route to them on the Dom0 from the WAN . The goal is > to > > have a remote port (say 10001) be redirected to the students virtual > > machine's port 22. Each student would access their VM using a different > > remote port. All of the students VMs will be copies (or using qcow2 > backing > > file) of a base image so will be identical to save space and setup time. > > > > It seems like I had it easy by setting vif = [ 'ip=x.x.x.x' ] but this > > doesn't seem to do anything. According to Running Xen you need to > statically > > set the ip inside the DomU as well as setting it in the domU config file. > > Doesn't setting it in both places defeat the purpose of having it in the > > DomU config file to start with? > > > > An update on the website about this: > http://runningxen.com/changes/ > > "The kernel has to be compiled with CONFIG_IP_PNP to enable the > automatic network settings. > > Then IP, Netmask, Gateway, … will set from config-file (as long, there > is no extra setting in domU's /etc/network/interfaces for eth0) > > grep IP_PNP /boot/config-2.6.-xen" shows you if it is set." - xen mailing > list > > > Related (old) bug report: > http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=471 > > I haven't test it yet, but it is worth looking into. > > Hope that helps. > > Cheers, > ToddThanks a million, I'm checking into it. This is definately not turned on in CentOS-xen kernels. Looks like a kernel compile is in the order. Maybe the CentOS/Redhat guys need to turn it on in the compile. Grant McWilliams Some people, when confronted with a problem, think "I know, I'll use Windows." Now they have two problems. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users