OpenVZ Forum


Home » General » Support » custom actions after "vzctl start"
custom actions after "vzctl start" [message #41100] Thu, 18 November 2010 17:01 Go to previous message
unliketea is currently offline  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

 
Read Message
Read Message
Read Message
Previous Topic: Howto: iotop on RHEL5 / CentOS5
Next Topic: Possible to export/import VE?
Goto Forum:
  


Current Time: Wed Jul 17 09:21:52 GMT 2024

Total time taken to generate the page: 0.02815 seconds