A method includes identifying relationships between containers on a first device, where each container includes at least one relationship that includes a HAS-A relationship or an IS-A relationship. The method further includes receiving a request to migrate at least a portion of the containers. The method also includes identifying a second device suitable for migration based on the request. Moreover, the method includes identifying a first group of containers from the containers to migrate to the second device based on the relationships. In addition, the method includes migrating the first group of containers to the second device.