vlead / ovpl

ADS - Automated Deployment Service
MIT License
0 stars 22 forks source link

[CentOSVZAdapter] - creation of container fails, when an IP is used - which already is assigned to a stopped container. #56

Closed travula closed 9 years ago

travula commented 9 years ago

Currently, an IP is usable if it it not pingable. An ip is not pingable though it is assgined to a stopped container. But, openvz cannot create a container when a IP assigned to a stopped container is used while createing a new container.

ecthiender commented 9 years ago

@ksripathi what is the current status on this? You will implement the DHCP-like thing? Maybe we can discuss this before you start implementing?

ksripathi commented 9 years ago

@ecthiender I have already worked on this issue and came up with implementation also later when Thirumal reviewed the code, he suggested me the best of resoving the issue. So I have to rethink about it.

Yes @ecthiender, I will discuss with you about this issue before I will start implementation.

ksripathi commented 9 years ago

@travula , @ecthiender

As Anon and I discussed solution for #56 issue we finalized that the following idea will resolve the issue.

Before returning an "ip_address" from "ovpl/src/adapters/BaseAdapter.py" we calculated "vm_id" based on "ip_address" and tested whether 'vm_id' is already exist or not (container status can be stopped or running) if it exists we bypass that ip_address and check for other "ip_address" and so on and finally return the "ip_address". This logic is working fine for "CentOSVZAdapter" adapter and tested well.

As "BaseAdapter.py" is common for all adapters. The same logic is not working for "CentOSBridgeAdapter" adapter and this is because in this adapter while calculating "vm_id" from "ip_address" we incremented it by 100. So I was thinking to write logic based on the adapter using "if" and "else" condition in "ovpl/src/adapter/BaseAdapter.py"

Please share your thoughts....

ksripathi commented 9 years ago

Done

ksripathi commented 9 years ago

execute_command() method has to tested.