custom actions after "vzctl start" [message #41100] |
Thu, 18 November 2010 17:01 ![Go to next message Go to next message](/theme/ovz3/images/down.png) |
unliketea
Messages: 4 Registered: November 2010 Location: US
|
Junior Member |
|
|
I am attempting to setup an implementation that allows for software/hardware independence on a large system of systems.
I've modified the /etc/init.d/vz script to automatically create create and initialize a local bridge, and add the local ethernet device (eth0) to it.
I've created the VEs such that they autoconfigure their network devices through vzctl --netif_add and creating a support /etc/sysconfig/networking-scripts/ifcfg-eth0 file for each.
At this point when I start a VE I have it autoconfigure all network parameters needed EXCEPT, adding the route on the host machine to the VE (via something like # ip route add 129.165.18.1 dev vmbr0)
Is there a way to force the above command whenever the device is started via a container configuration file option (something like EXTERNAL_SCRIPT or SYSTEM or CMD)
What are other peoples ways of automatically adding the appropriate ip routes when the VE is started? Is there a better way?
The next step of course is looking at how to remove the route when the VE is stopped (don't worry about the migration use case for now)
Thanks for your feedback
UPDATE!:
/etc/vz/conf/101.mount and /etc/vz/conf/101.umount were the trick ... allows for custom code execution upon starting and stopping the VE.
Eggcellent.
Cheers --Reed
[Updated on: Thu, 18 November 2010 17:41] Report message to a moderator
|
|
|
|
Re: custom actions after "vzctl start" [message #41204 is a reply to message #41101] |
Mon, 13 December 2010 04:04 ![Go to previous message Go to previous message](/theme/ovz3/images/up.png) |
kellyj994
Messages: 1 Registered: December 2010
|
Junior Member |
|
|
unliketea wrote on Thu, 18 November 2010 12:39update:
/etc/vz/conf/101.mount and /etc/vz/conf/101.umount were the trick ... allows for custom code execution upon starting and stopping the VE.
Eggcellent.
Cheers --Reed
Thanks you for the post.
|
|
|