code: def _delete_dead_service_vm_hosting_device(self, context, hosting_device):
          
          if hosting_device is None:
              return
          plugging_drv = self.get_hosting_device_plugging_driver(
              context, hosting_device['template_id'])
          hosting_device_drv = self.get_hosting_device_driver(
              context, hosting_device['template_id'])
          if plugging_drv is None or hosting_device_drv is None:
              return
          res = plugging_drv.get_hosting_device_resources(
              context, hosting_device['id'], hosting_device['complementary_id'],
              self.l3_tenant_id(), self.mgmt_nw_id())
          if not self.svc_vm_mgr.delete_service_vm(context,
                                                   hosting_device['id']):
              LOG.error('Failed to delete hosting device %s service VM. '
                        'Will un-register it anyway.',
                        hosting_device['id'])
          plugging_drv.delete_hosting_device_resources(
              context, self.l3_tenant_id(), **res)
          with context.session.begin(subtransactions=True):
              # remove all allocations in this hosting device
              context.session.query(hd_models.SlotAllocation).filter_by(
                  hosting_device_id=hosting_device['id']).delete()
              context.session.delete(hosting_device)
docs: Deletes a presumably dead <hosting_device> service VM.
  
          This will indirectly make all of its hosted resources unscheduled.