'Check whether attaching an interface is possible for the given
instance.
:returns: True if attaching / detaching interfaces is possible for the
given instance.'

def _check_hotplug_available(self, instance):

    vm_state = self._get_vm_state(instance.name)
    if (vm_state == os_win_const.HYPERV_VM_STATE_DISABLED):
        return True
    if (not self._hostutils.check_min_windows_version(10, 0)):
        LOG.debug('vNIC    hot    plugging    is    supported    only    in    newer    versions    than    Windows    Hyper-V    /    Server    2012    R2.')
        return False
    if (self._vmutils.get_vm_generation(instance.name) == constants.VM_GEN_1):
        LOG.debug('Cannot    hot    plug    vNIC    to    a    first    generation    VM.', instance=instance)
        return False
    return True
