Package starcluster :: Module volume :: Class VolumeCreator
[hide private]
[frames] | no frames]

Class VolumeCreator

source code


Handles creating, partitioning, and formatting a new EBS volume. By default this class will format the entire drive (without partitioning) using the ext3 filesystem.

host_instance - EC2 instance to use when formatting volume. must exist in the same zone as the new volume. if not specified this class will look for host instances in the @sc-volumecreator security group. If it can't find an instance in the @sc-volumecreator group that matches the zone of the new volume, a new instance is launched.

shutdown_instance - True will shutdown the host instance after volume creation

Instance Methods [hide private]
 
__init__(self, ec2_conn, spot_bid=None, keypair=None, key_location=None, host_instance=None, device='/dev/sdz', image_id='ami-8cf913e5', instance_type='m1.small', shutdown_instance=False, detach_vol=False, mkfs_cmd='mkfs.ext3', resizefs_cmd='resize2fs', **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__repr__(self)
repr(x)
source code
 
_get_existing_instance(self, zone)
Returns any existing instance in the @sc-volumecreator group that's located in zone.
source code
 
_request_instance(self, zone) source code
 
_create_volume(self, size, zone, snapshot_id=None) source code
 
_determine_device(self) source code
 
_attach_volume(self, vol, instance_id, device) source code
 
_validate_host_instance(self, instance, zone) source code
 
_validate_image_and_type(self, image, itype) source code
 
_validate_zone(self, zone) source code
 
_validate_size(self, size) source code
 
_validate_device(self, device) source code
 
_validate_required_progs(self, progs) source code
 
validate(self, size, zone, device) source code
 
is_valid(self, size, zone, device)
Returns True if all cluster template settings are valid
source code
 
_partition_volume(self) source code
 
_format_volume(self) source code
 
_warn_about_volume_hosts(self) source code
 
shutdown(self) source code
 
create(self, volume_size, volume_zone) source code
 
_validate_resize(self, vol, size) source code
 
resize(self, vol, size, dest_zone=None)
Resize EBS volume
source code

Inherited from cluster.Cluster: __getstate__, __str__, add_node, add_nodes, attach_volumes_to_master, create_cluster, create_node, create_nodes, detach_volumes, get, get_node_by_alias, get_node_by_dns_name, get_node_by_id, get_nodes_or_raise, get_spinner, get_spot_requests_or_raise, has_cluster_compute_nodes, has_ebs_nodes, has_spot_nodes, has_stoppable_nodes, is_cluster_compute, is_cluster_stopped, is_cluster_terminated, is_cluster_up, is_ebs_cluster, is_running_valid, is_spot_cluster, is_stoppable, load_plugins, load_receipt, load_volumes, remove_node, remove_nodes, restart_cluster, run_plugin, run_plugins, ssh_to_master, ssh_to_node, start, stop_cluster, terminate_cluster, update, wait_for_active_instances, wait_for_active_spots, wait_for_cluster, wait_for_running_instances, wait_for_ssh

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from cluster.Cluster: cluster_group, master_node, nodes, placement_group, progress_bar, running_nodes, spot_requests, stopped_nodes, zone

Inherited from cluster.Cluster (private): _security_group

Inherited from object: __class__

Method Details [hide private]

__init__(self, ec2_conn, spot_bid=None, keypair=None, key_location=None, host_instance=None, device='/dev/sdz', image_id='ami-8cf913e5', instance_type='m1.small', shutdown_instance=False, detach_vol=False, mkfs_cmd='mkfs.ext3', resizefs_cmd='resize2fs', **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

_validate_zone(self, zone)

source code 
Overrides: cluster.Cluster._validate_zone

is_valid(self, size, zone, device)

source code 

Returns True if all cluster template settings are valid

Overrides: cluster.Cluster.is_valid
(inherited documentation)

create(self, volume_size, volume_zone)

source code 
Decorators:
  • @print_timing("Creating volume")

resize(self, vol, size, dest_zone=None)

source code 

Resize EBS volume

vol - boto volume object size - new volume sze dest_zone - zone to create the new resized volume in. this must be within the original volume's region otherwise a manual copy (rsync) is required. this is currently not implemented.