starcluster.volume.VolumeCreator

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(*arg, **kargs) Raw timing function | 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_spinner`, `is_cluster_compute`, `is_cluster_stopped`, `is_cluster_terminated`, `is_cluster_up`, `is_ebs_cluster`, `is_running_valid`, `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_cluster` Inherited from `cluster.Cluster` (private): `_create_flat_rate_cluster`, `_create_spot_cluster`, `_get_launch_map`, `_get_next_node_num`, `_get_type_and_image_id`, `_has_all_required_settings`, `_nodes_in_states`, `_setup_cluster`, `_start`, `_validate`, `_validate_cluster_compute`, `_validate_cluster_size`, `_validate_credentials`, `_validate_ebs_aws_settings`, `_validate_ebs_settings`, `_validate_image_settings`, `_validate_instance_types`, `_validate_keypair`, `_validate_permission_settings`, `_validate_running_instances`, `_validate_shell_setting`, `_validate_spot_bid` 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(*arg, **kargs) | source code
Raw timing function 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.