def snapshot_from_bdm(snapshot_id, template):
 copy_from_template = ('disk_bus', 'device_type', 'boot_index', 'delete_on_termination', 'volume_size', 'device_name')
 snapshot_dict = {'source_type': 'snapshot', 'destination_type': 'volume', 'snapshot_id': snapshot_id}
 for key in copy_from_template:
  snapshot_dict[key] = template.get(key)
 return BlockDeviceDict(snapshot_dict)

def snapshot_from_bdm ( snapshot_id , template ) : copy_from_template = ( 'disk_bus' , 'device_type' , 'boot_index' , 'delete_on_termination' , 'volume_size' , 'device_name' ) snapshot_dict = { 'source_type' : 'snapshot' , 'destination_type' : 'volume' , 'snapshot_id' : snapshot_id } for key in copy_from_template : snapshot_dict [ key ] = template . get ( key ) return BlockDeviceDict ( snapshot_dict )
create a basic volume snapshot bdm from a given template bdm .