Create a snapshot of the volume identified by volume ID. A volume does not have to be detached at the time the snapshot is taken.
Snapshot creation requires that the system is in a consistent state. For instance, this means that if taking a snapshot of a database, the tables must be read-only locked to ensure that the snapshot will not contain a corrupted version of the database. Therefore, be careful when using this API to ensure that the system remains in the consistent state until the create snapshot status has returned.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The ID of the volume from which to create the snapshot. |
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Create a snapshot from an EBS volume.
// Instantiate the class $ec2 = new AmazonEC2(); // Create the snapshot $response = $ec2->create_snapshot('vol-fc482995', array( 'Description' => 'my-snapshot' )); // Success? var_dump($response->isOK());Result:
bool(true)
Changelog
Version |
Description |
---|---|
1.3.4 |
The CreateSnapshot operation introduced backwards-incompatible changes in the |
Related Methods
Source
Method defined in services/ec2.class.php | Toggle source view (7 lines) | View on GitHub