Scalr\Service\Aws\Ec2\DataType\VolumeData::detach PHP Метод

detach() публичный Метод

Detaches an Amazon EBS volume from an instance. Make sure to unmount any file systems on the device within your operating system before detaching the volume. Failure to do so will result in volume being stuck in "busy" state while detaching. Note! If an Amazon EBS volume is the root device of an instance, it cannot be detached while the instance is in the "running" state. To detach the root volume, stop the instance first. If the root volume is detached from an instance with an AWS Marketplace product code, then the AWS Marketplace product codes from that volume are no longer associated with the instance.
public detach ( string $instanceId = null, string $device = null, boolean $force = null ) : AttachmentSetResponseData
$instanceId string optional The ID of the Instance.
$device string optional The device name.
$force boolean optional Forces detachment if the previous detachment attempt did not occur cleanly (logging into an instance, unmounting the volume, and detaching normally). This option can lead to data loss or a corrupted file system. Use this option only as a last resort to detach a volume from a failed instance. The instance won't have an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures.
Результат AttachmentSetResponseData Returns AttachmentSetResponseData on success
    public function detach($instanceId = null, $device = null, $force = null)
    {
        $this->throwExceptionIfNotInitialized();
        return $this->getEc2()->volume->detach($this->volumeId, $instanceId, $device, $force);
    }