• Jérome Perrin's avatar
    proxy: support partitions destruction · a58c14b0
    Jérome Perrin authored
    So far implementation of slapos proxy was incomplete regarding partition destructions:
    A partition requested as destroyed was properly destroyed "physically", files were
    removed from filesystem, services were removed from supervisor, but the partition was
    still marked as busy in proxy database, so it was never re-used in subsequent requests.
    
    To solve this, implement the destroyedComputerPartition endpoint to mark the partition
    as free.
    
    This is straightworfard for root partitions, but the cases of child partitions was a bit
    more tricky, especially because software releases usually does not implement properly
    the chain of deletion (it seems this is not properly implemted with softwaretype, only
    with switch_softwaretype) and generally because we don't want to leave orpheans partitions.
    
    In the case of ERP5 implementation of SlapOS master we have an alarm which garbage
    collect in these cases, so we implement something to reach similar goals. We refuse freeing
    a partition while their child paritions are not freed - and we request deletion of these
    partitions so that they are deleted on next slapos node report run. Then after a few runs,
    the whole partition tree will be completely destroyed and freed, even for software which
    does not implement deletion properly.
    a58c14b0
views.py 37.3 KB