code: func (vs *VSphere) InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error) {
  	nodeName, err := vs.GetNodeNameFromProviderID(providerID)
  	if err != nil {
  		klog.Errorf("Error while getting nodename for providerID %s", providerID)
  		return false, err
  	}
  
  	vsi, err := vs.getVSphereInstance(convertToK8sType(nodeName))
  	if err != nil {
  		return false, err
  	}
  	// Ensure client is logged in and session is valid
  	if err := vs.nodeManager.vcConnect(ctx, vsi); err != nil {
  		return false, err
  	}
  	vm, err := vs.getVMFromNodeName(ctx, convertToK8sType(nodeName))
  	if err != nil {
  		klog.Errorf("Failed to get VM object for node: %q. err: +%v", nodeName, err)
  		return false, err
  	}
  	isActive, err := vm.IsActive(ctx)
  	if err != nil {
  		klog.Errorf("Failed to check whether node %q is active. err: %+v.", nodeName, err)
  		return false, err
  	}
  	return !isActive, nil
  }
docs: // InstanceShutdownByProviderID returns true if the instance is in safe state to detach volumes