public function deleteVolume($volumeId)
{
$result = false;
$options = ['VolumeId' => (string) $volumeId];
$response = $this->client->call(ucfirst(__FUNCTION__), $options);
if ($response->getError() === false) {
//Success
$sxml = simplexml_load_string($response->getRawContent());
if ((string) $sxml->return != 'true') {
throw new Ec2Exception(sprintf('Amazon Ec2 could not delete the volume with ID "%s". It returned "%s"', $options['VolumeId'], $sxml->return));
}
$result = true;
$entity = $this->ec2->getEntityManagerEnabled() ? $this->ec2->volume->get($options['VolumeId']) : null;
if ($entity !== null) {
$this->getEntityManager()->detach($entity);
}
}
return $result;
}