HI MACscr,
I think i saw some “Actions on Xen state changes” somewhere in the XEN create system screen.
If somewhere in Cloudmin, for this particular instance, there would be an “Scripts to execute on Xen state changes” (Start, Stop, Pause, Delete) , then it could be possible to create a script that would read the .cfg file, find the “vif = [’’]” line and read between the brackets
Till then i made my own try and dig.
While the creation was being done, i’ve made a sneak peek to the new machine .cfg file
[root@centos5 xen]# cat centos5.cfg
kernel = ‘/xen/vmlinuz-vm2-xenU’
ramdisk = ‘/xen/initrd.vm2.xenU.img’
memory = 512
name = ‘centos5’
vif = [ ‘’ ]
address = ‘192.168.1.180’
netmask = ‘255.255.255.0’
disk = [‘file:/xen/centos5.img,sda1,w’,‘file:/xen/centos5.swap,sda2,w’]
root = ‘/dev/sda1 ro’
And it was like that even after i’ve started the VM. No vif info…
I did give another go and, this time i’ve created a second machine but, i decided to give a name to the interface. When creating a new Xen System, you are able to go to Advanced options and give the interface name at “Virtual interface name” (choose custom name). I gave the name flc4 (not flc4.4 or flc4.0 … it gaved me a some errors).
So after the machine was created, i could see its .cfg file and guess what !
[root@centos5 xen]# cat centos5dois.cfg
kernel = ‘/xen/vmlinuz-vm2-xenU’
ramdisk = ‘/xen/initrd.vm2.xenU.img’
memory = 256
name = ‘centos5dois’
vif = [ ‘vifname=flc4’ ]
address = ‘192.168.1.181’
netmask = ‘255.255.255.0’
disk = [‘file:/xen/centos5dois.img,sda1,w’]
root = ‘/dev/sda1 ro’
[root@centos5 xen]#
I could find a vifname on this line, the one I’ve configured. So, after I started the VM, making command bellow:
#>ifconfig
flc4 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF
inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
RX packets:35 errors:0 dropped:0 overruns:0 frame:0
TX packets:1838 errors:0 dropped:330 overruns:0 carrier:0
collisions:0 txqueuelen:32
RX bytes:3526 (3.4 KiB) TX bytes:280119 (273.5 KiB)
This is just another interface that i believe that you can now control with iptables.
I do now that it is possible to configure ip’s and mac address’s also on the vif line.
So, in the end, just personalize your interface and add it to your iptable’s rules.
Scripting might help to charge rules on the fly on iptables, reading the .cfg file, extracting the vif content , and adding it to iptables configuration, on start up VMs. Doing exactly the same when Shutting down VMs. But that only when Cloudmin allows to run scripts on Xen Change Status.
Hope it helps,
Fil