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 next 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

Re: custom actions after "vzctl start" [message #41101 is a reply to message #41100] Thu, 18 November 2010 17:39 Go to previous messageGo to next message
unliketea is currently offline  unliketea
Messages: 4
Registered: November 2010
Location: US
Junior Member
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
Re: custom actions after "vzctl start" [message #41204 is a reply to message #41101] Mon, 13 December 2010 04:04 Go to previous message
kellyj994 is currently offline  kellyj994
Messages: 1
Registered: December 2010
Junior Member
unliketea wrote on Thu, 18 November 2010 12:39
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


Thanks you for the post.
Previous Topic: Howto: iotop on RHEL5 / CentOS5
Next Topic: Possible to export/import VE?
Goto Forum:
  


Current Time: Wed Jul 17 13:14:43 GMT 2024

Total time taken to generate the page: 0.02727 seconds