Revision f22ca784

View differences:

src/dm/DispatchManagerActions.cc
768 768
    string& error_str)
769 769
{
770 770
    VirtualMachine * vm;
771
    Host * host;
771 772
    ostringstream oss;
772 773

  
773 774
    VirtualMachine::VmState state;
775
    bool is_public_host;
774 776

  
775
    vm = vmpool->get(vid,true);
777
    vm   = vmpool->get(vid,true);
778

  
779
    host           = hpool->get(vm->get_hid(),true);
780
    is_public_host = host->is_public_cloud();
781
    host->unlock();
782
    
776 783

  
777 784
    if ( vm == 0 )
778 785
    {
......
793 800
            vm->get_requirements(cpu,mem,disk);
794 801
            hpool->del_capacity(vm->get_hid(), vm->get_oid(), cpu, mem, disk);
795 802

  
796
            tm->trigger(TransferManager::EPILOG_DELETE,vid);
803
            if (is_public_host)
804
            {
805
                vmm->trigger(VirtualMachineManager::CLEANUP,vid);
806
            }
807
            else
808
            {
809
                tm->trigger(TransferManager::EPILOG_DELETE,vid);
810
            }
811

  
797 812
            finalize_cleanup(vm);
798 813
        break;
799 814

  
800 815
        case VirtualMachine::STOPPED:
801 816
        case VirtualMachine::UNDEPLOYED:
802
            tm->trigger(TransferManager::EPILOG_DELETE_STOP,vid);
817
            if (is_public_host)
818
            {
819
                vmm->trigger(VirtualMachineManager::CLEANUP,vid);
820
            }
821
            else
822
            {
823
                tm->trigger(TransferManager::EPILOG_DELETE,vid);
824
            }
825

  
803 826
            finalize_cleanup(vm);
804 827
        break;
805 828

  
src/vmm_mad/remotes/vcenter/vcenter_driver.rb
232 232
    # @return [Hash] in the form
233 233
    #   {dc_name [String] => ClusterComputeResources Names [Array - String]}
234 234
    ########################################################################
235
    def hierarchy
235
    def hierarchy(one_client=nil)
236 236
        vc_hosts = {}
237 237

  
238 238
        datacenters = get_entities(@root, 'Datacenter')
239 239

  
240
        hpool = OpenNebula::HostPool.new((one_client||@one))
241
        rc    = hpool.info
242

  
240 243
        datacenters.each { |dc|
241 244
            ccrs = get_entities(dc.hostFolder, 'ClusterComputeResource')
242
            vc_hosts[dc.name] = ccrs.collect { |c| c.name }
245
            vc_hosts[dc.name] = []
246
            ccrs.each { |c|
247
                puts c.name
248
                if !hpool["HOST[NAME=\"c.name\"]"]
249
                    vc_hosts[dc.name] << c.name
250
                end
251
              }
243 252
        }
244 253

  
245 254
        return vc_hosts

Also available in: Unified diff