create_cachedi_scsi_volume
¶
create_cachedi_scsi_volume(
gateway_arn: GatewayARN,
volume_size_in_bytes: long,
target_name: TargetName,
network_interface_id: NetworkInterfaceId,
client_token: ClientToken,
*,
config_overrides: Optional[StorageGatewayClientConfig] = None,
snapshot_id: Optional[SnapshotId] = None,
source_volume_arn: Optional[VolumeARN] = None,
kms_encrypted: Optional[Boolean] = None,
kms_key: Optional[KMSKey] = None,
tags: Optional[Tags] = None,
) -> CreateCachediSCSIVolumeOutput
Creates a cached volume on a specified cached volume gateway. This operation is only supported in the cached volume gateway type.
Cache storage must be allocated to the gateway before you can create a cached volume. Use the AddCache operation to add cache storage to a gateway.
In the request, you must specify the gateway, size of the volume in bytes, the iSCSI target name, an IP address on which to expose the target, and a unique client token. In response, the gateway creates the volume and returns information about it. This information includes the volume Amazon Resource Name (ARN), its size, and the iSCSI target ARN that initiators can use to connect to the volume target.
Optionally, you can provide the ARN for an existing volume as the SourceVolumeARN for this cached volume, which creates an exact copy of the existing volume’s latest recovery point. The VolumeSizeInBytes value must be equal to or larger than the size of the copied volume, in bytes.
Parameters:
-
volume_size_in_bytes(long) –The size of the volume in bytes.
-
snapshot_id(Optional[SnapshotId], default:None) –The snapshot ID (e.g. "snap-1122aabb") of the snapshot to restore as the new cached volume. Specify this field if you want to create the iSCSI storage volume from a snapshot; otherwise, do not include this field. To list snapshots for your account use DescribeSnapshots in the Amazon Elastic Compute Cloud API Reference.
-
target_name(TargetName) –The name of the iSCSI target used by an initiator to connect to a volume and used as a suffix for the target ARN. For example, specifying
TargetNameas myvolume results in the target ARN ofarn:aws:storagegateway:us-east-2:111122223333:gateway/sgw-12A3456B/target/iqn.1997-05.com.amazon:myvolume. The target name must be unique across all volumes on a gateway.If you don't specify a value, Storage Gateway uses the value that was previously used for this volume as the new target name.
-
source_volume_arn(Optional[VolumeARN], default:None) –The ARN for an existing volume. Specifying this ARN makes the new volume into an exact copy of the specified existing volume's latest recovery point. The
VolumeSizeInBytesvalue for this new volume must be equal to or larger than the size of the existing volume, in bytes. -
network_interface_id(NetworkInterfaceId) –The network interface of the gateway on which to expose the iSCSI target. Accepts IPv4 and IPv6 addresses. Use DescribeGatewayInformation to get a list of the network interfaces available on a gateway.
Valid Values: A valid IP address.
-
client_token(ClientToken) –A unique identifier that you use to retry a request. If you retry a request, use the same
ClientTokenyou specified in the initial request. -
kms_encrypted(Optional[Boolean], default:None) –Set to
trueto use Amazon S3 server-side encryption with your own KMS key, orfalseto use a key managed by Amazon S3. Optional.Valid Values:
true|false -
kms_key(Optional[KMSKey], default:None) –The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used for Amazon S3 server-side encryption. Storage Gateway does not support asymmetric CMKs. This value can only be set when
KMSEncryptedistrue. Optional. -
tags(Optional[Tags], default:None) –A list of up to 50 tags that you can assign to a cached volume. Each tag is a key-value pair.
Valid characters for key and value are letters, spaces, and numbers that you can represent in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256 characters.
Raises:
-
InternalServerError–An internal server error has occurred during the request. For more information, see the error and message fields.
-
InvalidGatewayRequestException–An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To create a cached iSCSI volume Creates a cached volume on a specified cached gateway.
>>> client.create_cachedi_scsi_volume(gateway_arn='arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B', volume_size_in_bytes=536870912000, snapshot_id='snap-f47b7b94', target_name='my-volume', network_interface_id='10.1.1.1', client_token='cachedvol112233')
Source code in docs_src/capo_storage_gateway/_services/storage_gateway.py
1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 | |