Attach a previously created volume to a running instance.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone and the instance must be running. |
|
|
Required |
The ID of the instance to which the volume attaches. The volume and instance must be within the same Availability Zone and the instance must be running. |
|
|
Required |
Specifies how the device is exposed to the instance (e.g., |
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Attach an EBS volume to a running instance.
// Instantiate the class $ec2 = new AmazonEC2(); // Attach the volume $response = $ec2->attach_volume('vol-fc482995', 'i-1f549375', '/dev/sdg'); // Success? var_dump($response->isOK());Result:
bool(true)
Related Methods
Source
Method defined in services/ec2.class.php | Toggle source view (9 lines) | View on GitHub