Comment 8 for bug 1192416

Revision history for this message
renminmin (rmm0811) wrote : Re: cinder/scheduler/host_manager.py , line 268, in get_all_host_states

I found the same problem.
I think the code of host_manange.py/get_all_host_states need to change like this.

########################################
for service in volume_services:
            if not utils.service_is_up(service) or service['disabled']:
                LOG.warn(_("service is down or disabled. Host name :%s")
                    % service['host'])
                _host = self.host_state_map.get(service['host'])
                if _host:
                    self.host_state_map.pop(service['host'])
                continue
            host = service['host']
########################################
The reason is that get_all_host_states method is use to get all service state and cinder scheduler choose the cinder-volume service from them.
Then when cinder-volume service is down or disabled, the state of bad one need remove from host_state_map list.