Repository: cloud-custodian/cloud-custodian

Issue:
Cannot ec2.actions.copy-tags Name tag to ebs snapshot: Duplicate tag key 'Name' specified
This policy

```yaml
policies:
- name: ec2-daily-backup
  resource: ec2
  description: |
    Creates a snapshot of every EBS volume daily when
    custodian runs its full scan
  filters:
    - type: value
      key: "[length(Tags)][0]"
      op: lte
      value: 2
  actions:
    - type: snapshot
      copy-tags:
        - Name
        - role
```

Returns this error

```bash
ClientError: An error occurred (InvalidParameterValue) when calling the CreateSnapshot operation: Duplicate tag key 'Name' specified.
```



Discussion:
The action internally specifies name, this should probably be a validation error or a replacement of the extant logic, currently it looks like name is set to the volume id.
@kapilt id prefer overriding it if `Name` is being copied. I can work on a PR for this

Resolving patch:
diff --git a/c7n/resources/ec2.py b/c7n/resources/ec2.py
--- a/c7n/resources/ec2.py
+++ b/c7n/resources/ec2.py
@@ -1316,70 +1316,70 @@ class Snapshot(BaseAction):
 
     schema = type_schema(
         'snapshot',
-        **{'copy-tags': {'type': 'array', 'items': {'type': 'string'}}})
+        **{'copy-tags': {'type': 'array', 'items': {'type': 'string'}},
+           'copy-volume-tags': {'type': 'boolean'},
+           'exclude-boot': {'type': 'boolean', 'default': False}})
     permissions = ('ec2:CreateSnapshot', 'ec2:CreateTags',)
 
+    def validate(self):
+        if self.data.get('copy-tags') and 'copy-volume-tags' in self.data:
+            raise PolicyValidationError(
+                "Can specify copy-tags or copy-volume-tags, not both")
+
     def process(self, resources):
-        client = utils.local_session(
-            self.manager.session_factory).client('ec2')
+        client = utils.local_session(self.manager.session_factory).client('ec2')
+        err = None
         with self.executor_factory(max_workers=2) as w:
-            futures = []
+            futures = {}
             for resource in resources:
-                futures.append(w.submit(
-                    self.process_volume_set, client, resource))
+                futures[w.submit(
+                    self.process_volume_set, client, resource)] = resource
             for f in as_completed(futures):
                 if f.exception():
-                    raise f.exception()
+                    err = f.exception()
+                    resource = futures[f]
                     self.log.error(
-                        "Exception creating snapshot set \n %s" % (
-                            f.exception()))
+                        "Exception creating snapshot set instance:%s \n %s" % (
+                            resource['InstanceId'], err))
+        if err:
+            raise err
 
     def process_volume_set(self, client, resource):
-        for block_device in resource['BlockDeviceMappings']:
-            if 'Ebs' not in block_device:
-                continue
-            volume_id = block_device['Ebs']['VolumeId']
-            description = "Automated,Backup,%s,%s" % (
-                resource['InstanceId'], volume_id)
-            tags = self.get_snapshot_tags(resource, block_device)
-            try:
-                self.manager.retry(
-                    client.create_snapshot,
-                    DryRun=self.manager.config.dryrun,
-                    VolumeId=volume_id,
-                    Description=description,
-                    TagSpecifications=[{
-                        'ResourceType': 'snapshot',
-                        'Tags': tags}])
-            except ClientError as e:
-                if e.response['Error']['Code'] == 'IncorrectState':
-                    self.log.warning(
-                        "action:%s volume:%s is incorrect state" % (
-                            self.__class__.__name__.lower(),
-                            volume_id))
-                    continue
+        params = dict(
+            InstanceSpecification={
+                'ExcludeBootVolume': self.data.get('exclude-boot', False),
+                'InstanceId': resource['InstanceId']})
+        if 'copy-tags' in self.data:
+            params['TagSpecifications'] = [{
+                'ResourceType': 'snapshot',
+                'Tags': self.get_snapshot_tags(resource)}]
+        elif self.data.get('copy-volume-tags', True):
+            params['CopyTagsFromSource'] = 'volume'
+
+        try:
+            result = self.manager.retry(client.create_snapshots, **params)
+            resource['c7n:snapshots'] = [
+                s['SnapshotId'] for s in result['Snapshots']]
+        except ClientError as e:
+            err_code = e.response['Error']['Code']
+            if err_code not in (
+                    'InvalidInstanceId.NotFound',
+                    'ConcurrentSnapshotLimitExceeded',
+                    'IncorrectState'):
                 raise
+            self.log.warning(
+                "action:snapshot instance:%s error:%s",
+                resource['InstanceId'], err_code)
 
-    def get_snapshot_tags(self, resource, block_device):
+    def get_snapshot_tags(self, resource):
         tags = [
-            {'Key': 'Name', 'Value': block_device['Ebs']['VolumeId']},
-            {'Key': 'InstanceId', 'Value': resource['InstanceId']},
-            {'Key': 'DeviceName', 'Value': block_device['DeviceName']},
             {'Key': 'custodian_snapshot', 'Value': ''}]
-
         copy_keys = self.data.get('copy-tags', [])
         copy_tags = []
         if copy_keys:
             for t in resource.get('Tags', []):
                 if t['Key'] in copy_keys:
                     copy_tags.append(t)
-
-            if len(copy_tags) + len(tags) > 40:
-                self.log.warning(
-                    "action:%s volume:%s too many tags to copy" % (
-                        self.__class__.__name__.lower(),
-                        block_device['Ebs']['VolumeId']))
-                copy_tags = []
             tags.extend(copy_tags)
         return tags
 


Test patch:
diff --git a/tests/data/placebo/test_ec2_snapshot/ec2.CreateSnapshot_1.json b/tests/data/placebo/test_ec2_snapshot/ec2.CreateSnapshot_1.json
deleted file mode 100644
--- a/tests/data/placebo/test_ec2_snapshot/ec2.CreateSnapshot_1.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
-    "status_code": 200, 
-    "data": {
-        "Description": "Automated,Backup,i-1aebf7c0,vol-2b047792", 
-        "ResponseMetadata": {
-            "HTTPStatusCode": 200, 
-            "RequestId": "d34d98e7-79c5-4a7d-a9ac-460394ad3f1b"
-        }, 
-        "Encrypted": false, 
-        "VolumeId": "vol-2b047792", 
-        "State": "pending", 
-        "VolumeSize": 8, 
-        "Progress": "", 
-        "StartTime": {
-            "hour": 0, 
-            "__class__": "datetime", 
-            "month": 5, 
-            "second": 18, 
-            "microsecond": 0, 
-            "year": 2016, 
-            "day": 8, 
-            "minute": 13
-        }, 
-        "SnapshotId": "snap-a55e3c59", 
-        "OwnerId": "619193117841"
-    }
-}
\ No newline at end of file
diff --git a/tests/data/placebo/test_ec2_snapshot/ec2.CreateSnapshots_1.json b/tests/data/placebo/test_ec2_snapshot/ec2.CreateSnapshots_1.json
new file mode 100644
--- /dev/null
+++ b/tests/data/placebo/test_ec2_snapshot/ec2.CreateSnapshots_1.json
@@ -0,0 +1,121 @@
+{
+    "status_code": 200,
+    "data": {
+        "Snapshots": [
+            {
+                "Description": "",
+                "Tags": [
+                    {
+                        "Key": "App",
+                        "Value": "DevX"
+                    },
+                    {
+                        "Key": "Stage",
+                        "Value": "Dev"
+                    },
+                    {
+                        "Key": "Name",
+                        "Value": "Foo"
+                    }
+                ],
+                "Encrypted": false,
+                "VolumeId": "vol-05117418b3ad30481",
+                "State": "pending",
+                "VolumeSize": 8,
+                "StartTime": {
+                    "__class__": "datetime",
+                    "year": 2019,
+                    "month": 6,
+                    "day": 11,
+                    "hour": 21,
+                    "minute": 15,
+                    "second": 27,
+                    "microsecond": 0
+                },
+                "Progress": "",
+                "OwnerId": "644160558196",
+                "SnapshotId": "snap-02b46f92846a4be3a"
+            },
+            {
+                "Description": "",
+                "Tags": [
+                    {
+                        "Key": "App",
+                        "Value": "DevX"
+                    },
+                    {
+                        "Key": "Stage",
+                        "Value": "Dev"
+                    },
+                    {
+                        "Key": "Name",
+                        "Value": "Foo"
+                    }
+                ],
+                "Encrypted": false,
+                "VolumeId": "vol-0caf24c45a8aa4b11",
+                "State": "pending",
+                "VolumeSize": 8,
+                "StartTime": {
+                    "__class__": "datetime",
+                    "year": 2019,
+                    "month": 6,
+                    "day": 11,
+                    "hour": 21,
+                    "minute": 15,
+                    "second": 27,
+                    "microsecond": 0
+                },
+                "Progress": "",
+                "OwnerId": "644160558196",
+                "SnapshotId": "snap-0e0c7752f8351db03"
+            },
+            {
+                "Description": "",
+                "Tags": [
+                    {
+                        "Key": "App",
+                        "Value": "DevX"
+                    },
+                    {
+                        "Key": "Stage",
+                        "Value": "Dev"
+                    },
+                    {
+                        "Key": "Name",
+                        "Value": "Foo"
+                    }
+                ],
+                "Encrypted": false,
+                "VolumeId": "vol-0188a91cfcb95c342",
+                "State": "pending",
+                "VolumeSize": 8,
+                "StartTime": {
+                    "__class__": "datetime",
+                    "year": 2019,
+                    "month": 6,
+                    "day": 11,
+                    "hour": 21,
+                    "minute": 15,
+                    "second": 27,
+                    "microsecond": 0
+                },
+                "Progress": "",
+                "OwnerId": "644160558196",
+                "SnapshotId": "snap-041502e4149c93d23"
+            }
+        ],
+        "ResponseMetadata": {
+            "RequestId": "0bfcaf79-b125-4784-9e84-d1876bb01dca",
+            "HTTPStatusCode": 200,
+            "HTTPHeaders": {
+                "content-type": "text/xml;charset=UTF-8",
+                "transfer-encoding": "chunked",
+                "vary": "accept-encoding",
+                "date": "Tue, 11 Jun 2019 21:15:27 GMT",
+                "server": "AmazonEC2"
+            },
+            "RetryAttempts": 0
+        }
+    }
+}
\ No newline at end of file
diff --git a/tests/data/placebo/test_ec2_snapshot/ec2.CreateTags_1.json b/tests/data/placebo/test_ec2_snapshot/ec2.CreateTags_1.json
deleted file mode 100644
--- a/tests/data/placebo/test_ec2_snapshot/ec2.CreateTags_1.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-    "status_code": 200, 
-    "data": {
-        "ResponseMetadata": {
-            "HTTPStatusCode": 200, 
-            "RequestId": "9dc254ea-f220-4982-b6ab-f30ba1739c4e"
-        }
-    }
-}
\ No newline at end of file
diff --git a/tests/data/placebo/test_ec2_snapshot/ec2.DescribeInstances_1.json b/tests/data/placebo/test_ec2_snapshot/ec2.DescribeInstances_1.json
--- a/tests/data/placebo/test_ec2_snapshot/ec2.DescribeInstances_1.json
+++ b/tests/data/placebo/test_ec2_snapshot/ec2.DescribeInstances_1.json
@@ -1,274 +1,212 @@
 {
-    "status_code": 200, 
+    "status_code": 200,
     "data": {
         "Reservations": [
             {
-                "OwnerId": "619193117841", 
-                "ReservationId": "r-6de0fb9a", 
-                "Groups": [], 
+                "Groups": [],
                 "Instances": [
                     {
-                        "Monitoring": {
-                            "State": "disabled"
-                        }, 
-                        "PublicDnsName": "", 
-                        "KernelId": "aki-fc8f11cc", 
-                        "State": {
-                            "Code": 48, 
-                            "Name": "terminated"
-                        }, 
-                        "EbsOptimized": false, 
+                        "AmiLaunchIndex": 0,
+                        "ImageId": "ami-07b4156579ea1d7ba",
+                        "InstanceId": "i-063c6794763254b51",
+                        "InstanceType": "t3.small",
                         "LaunchTime": {
-                            "hour": 14, 
-                            "__class__": "datetime", 
-                            "month": 11, 
-                            "second": 40, 
-                            "microsecond": 0, 
-                            "year": 2015, 
-                            "day": 24, 
-                            "minute": 40
-                        }, 
-                        "ProductCodes": [], 
-                        "Tags": [
-                            {
-                                "Value": "Packer Builder", 
-                                "Key": "Name"
-                            }
-                        ], 
-                        "InstanceId": "i-b2d2a876", 
-                        "ImageId": "ami-37501207", 
-                        "PrivateDnsName": "", 
-                        "KeyName": "packer 565476e7-2661-74e8-3a92-df2848e11888", 
-                        "SecurityGroups": [], 
-                        "ClientToken": "", 
-                        "InstanceType": "m3.medium", 
-                        "NetworkInterfaces": [], 
-                        "Placement": {
-                            "Tenancy": "default", 
-                            "GroupName": "", 
-                            "AvailabilityZone": "us-west-2a"
-                        }, 
-                        "Hypervisor": "xen", 
-                        "BlockDeviceMappings": [], 
-                        "Architecture": "x86_64", 
-                        "StateReason": {
-                            "Message": "Client.UserInitiatedShutdown: User initiated shutdown", 
-                            "Code": "Client.UserInitiatedShutdown"
-                        }, 
-                        "RootDeviceName": "/dev/sda1", 
-                        "VirtualizationType": "paravirtual", 
-                        "RootDeviceType": "ebs", 
-                        "StateTransitionReason": "User initiated (2015-11-25 10:11:55 GMT)", 
-                        "AmiLaunchIndex": 0
-                    }
-                ]
-            }, 
-            {
-                "OwnerId": "619193117841", 
-                "ReservationId": "r-152e35e2", 
-                "Groups": [], 
-                "Instances": [
-                    {
+                            "__class__": "datetime",
+                            "year": 2019,
+                            "month": 6,
+                            "day": 11,
+                            "hour": 20,
+                            "minute": 56,
+                            "second": 23,
+                            "microsecond": 0
+                        },
                         "Monitoring": {
                             "State": "disabled"
-                        }, 
-                        "PublicDnsName": "", 
-                        "RootDeviceType": "ebs", 
-                        "State": {
-                            "Code": 48, 
-                            "Name": "terminated"
-                        }, 
-                        "EbsOptimized": true, 
-                        "LaunchTime": {
-                            "hour": 11, 
-                            "__class__": "datetime", 
-                            "month": 11, 
-                            "second": 14, 
-                            "microsecond": 0, 
-                            "year": 2015, 
-                            "day": 24, 
-                            "minute": 7
-                        }, 
-                        "ProductCodes": [], 
-                        "StateTransitionReason": "User initiated (2015-11-25 10:11:55 GMT)", 
-                        "InstanceId": "i-13413bd7", 
-                        "ImageId": "ami-ef65758e", 
-                        "PrivateDnsName": "", 
-                        "KeyName": "HazmatGreenField", 
-                        "SecurityGroups": [], 
-                        "ClientToken": "rWCNH1448363234434", 
-                        "InstanceType": "m4.xlarge", 
-                        "NetworkInterfaces": [], 
+                        },
                         "Placement": {
-                            "Tenancy": "default", 
-                            "GroupName": "", 
-                            "AvailabilityZone": "us-west-2a"
-                        }, 
-                        "Hypervisor": "xen", 
-                        "BlockDeviceMappings": [], 
-                        "Architecture": "x86_64", 
-                        "StateReason": {
-                            "Message": "Client.UserInitiatedShutdown: User initiated shutdown", 
-                            "Code": "Client.UserInitiatedShutdown"
-                        }, 
-                        "RootDeviceName": "/dev/sda1", 
-                        "VirtualizationType": "hvm", 
-                        "Tags": [
-                            {
-                                "Value": "Spinnaker", 
-                                "Key": "Name"
-                            }
-                        ], 
-                        "AmiLaunchIndex": 0
-                    }
-                ]
-            }, 
-            {
-                "OwnerId": "619193117841", 
-                "ReservationId": "r-d123af7f", 
-                "Groups": [], 
-                "Instances": [
-                    {
-                        "Monitoring": {
-                            "State": "disabled"
-                        }, 
-                        "PublicDnsName": "", 
-                        "RootDeviceType": "ebs", 
+                            "AvailabilityZone": "us-east-1a",
+                            "GroupName": "",
+                            "Tenancy": "default"
+                        },
+                        "PrivateDnsName": "ip-172-31-11-37.ec2.internal",
+                        "PrivateIpAddress": "172.31.11.37",
+                        "ProductCodes": [],
+                        "PublicDnsName": "ec2-100-26-36-220.compute-1.amazonaws.com",
+                        "PublicIpAddress": "100.26.36.220",
                         "State": {
-                            "Code": 80, 
-                            "Name": "stopped"
-                        }, 
-                        "EbsOptimized": false, 
-                        "LaunchTime": {
-                            "hour": 23, 
-                            "__class__": "datetime", 
-                            "month": 5, 
-                            "second": 19, 
-                            "microsecond": 0, 
-                            "year": 2016, 
-                            "day": 7, 
-                            "minute": 37
-                        }, 
-                        "PrivateIpAddress": "172.31.8.154", 
-                        "ProductCodes": [], 
-                        "VpcId": "vpc-399e3d52", 
-                        "StateTransitionReason": "User initiated (2016-05-08 00:11:52 GMT)", 
-                        "InstanceId": "i-1aebf7c0", 
-                        "ImageId": "ami-c229c0a2", 
-                        "PrivateDnsName": "ip-172-31-8-154.us-west-2.compute.internal", 
-                        "KeyName": "HazmatGreenField", 
-                        "SecurityGroups": [
+                            "Code": 16,
+                            "Name": "running"
+                        },
+                        "StateTransitionReason": "",
+                        "SubnetId": "subnet-914763e7",
+                        "VpcId": "vpc-d2d616b5",
+                        "Architecture": "x86_64",
+                        "BlockDeviceMappings": [
                             {
-                                "GroupName": "jlxc", 
-                                "GroupId": "sg-47b76f22"
-                            }, 
+                                "DeviceName": "/dev/sda1",
+                                "Ebs": {
+                                    "AttachTime": {
+                                        "__class__": "datetime",
+                                        "year": 2019,
+                                        "month": 6,
+                                        "day": 11,
+                                        "hour": 20,
+                                        "minute": 56,
+                                        "second": 23,
+                                        "microsecond": 0
+                                    },
+                                    "DeleteOnTermination": true,
+                                    "Status": "attached",
+                                    "VolumeId": "vol-0caf24c45a8aa4b11"
+                                }
+                            },
+                            {
+                                "DeviceName": "/dev/sdb",
+                                "Ebs": {
+                                    "AttachTime": {
+                                        "__class__": "datetime",
+                                        "year": 2019,
+                                        "month": 6,
+                                        "day": 11,
+                                        "hour": 20,
+                                        "minute": 56,
+                                        "second": 23,
+                                        "microsecond": 0
+                                    },
+                                    "DeleteOnTermination": true,
+                                    "Status": "attached",
+                                    "VolumeId": "vol-0188a91cfcb95c342"
+                                }
+                            },
                             {
-                                "GroupName": "default", 
-                                "GroupId": "sg-0a08e365"
+                                "DeviceName": "/dev/sdc",
+                                "Ebs": {
+                                    "AttachTime": {
+                                        "__class__": "datetime",
+                                        "year": 2019,
+                                        "month": 6,
+                                        "day": 11,
+                                        "hour": 20,
+                                        "minute": 56,
+                                        "second": 23,
+                                        "microsecond": 0
+                                    },
+                                    "DeleteOnTermination": true,
+                                    "Status": "attached",
+                                    "VolumeId": "vol-05117418b3ad30481"
+                                }
                             }
-                        ], 
-                        "ClientToken": "JlRpx1460611049040", 
-                        "SubnetId": "subnet-389e3d53", 
-                        "InstanceType": "m3.medium", 
+                        ],
+                        "ClientToken": "",
+                        "EbsOptimized": true,
+                        "EnaSupport": true,
+                        "Hypervisor": "xen",
                         "NetworkInterfaces": [
                             {
-                                "Status": "in-use", 
-                                "MacAddress": "0a:d4:67:1f:58:03", 
-                                "SourceDestCheck": true, 
-                                "VpcId": "vpc-399e3d52", 
-                                "Description": "", 
-                                "NetworkInterfaceId": "eni-68d48235", 
-                                "PrivateIpAddresses": [
-                                    {
-                                        "PrivateDnsName": "ip-172-31-8-154.us-west-2.compute.internal", 
-                                        "Primary": true, 
-                                        "PrivateIpAddress": "172.31.8.154"
-                                    }
-                                ], 
-                                "PrivateDnsName": "ip-172-31-8-154.us-west-2.compute.internal", 
+                                "Association": {
+                                    "IpOwnerId": "amazon",
+                                    "PublicDnsName": "ec2-100-26-36-220.compute-1.amazonaws.com",
+                                    "PublicIp": "100.26.36.220"
+                                },
                                 "Attachment": {
-                                    "Status": "attached", 
-                                    "DeviceIndex": 0, 
-                                    "DeleteOnTermination": true, 
-                                    "AttachmentId": "eni-attach-f1c55f38", 
                                     "AttachTime": {
-                                        "hour": 5, 
-                                        "__class__": "datetime", 
-                                        "month": 4, 
-                                        "second": 29, 
-                                        "microsecond": 0, 
-                                        "year": 2016, 
-                                        "day": 14, 
-                                        "minute": 17
-                                    }
-                                }, 
+                                        "__class__": "datetime",
+                                        "year": 2019,
+                                        "month": 6,
+                                        "day": 11,
+                                        "hour": 20,
+                                        "minute": 56,
+                                        "second": 23,
+                                        "microsecond": 0
+                                    },
+                                    "AttachmentId": "eni-attach-0125cf6988c1ec962",
+                                    "DeleteOnTermination": true,
+                                    "DeviceIndex": 0,
+                                    "Status": "attached"
+                                },
+                                "Description": "",
                                 "Groups": [
                                     {
-                                        "GroupName": "jlxc", 
-                                        "GroupId": "sg-47b76f22"
-                                    }, 
+                                        "GroupName": "default",
+                                        "GroupId": "sg-6c7fa917"
+                                    }
+                                ],
+                                "Ipv6Addresses": [],
+                                "MacAddress": "0a:9f:f7:9f:2d:24",
+                                "NetworkInterfaceId": "eni-00eb9a1bebb7a0d0c",
+                                "OwnerId": "644160558196",
+                                "PrivateDnsName": "ip-172-31-11-37.ec2.internal",
+                                "PrivateIpAddress": "172.31.11.37",
+                                "PrivateIpAddresses": [
                                     {
-                                        "GroupName": "default", 
-                                        "GroupId": "sg-0a08e365"
+                                        "Association": {
+                                            "IpOwnerId": "amazon",
+                                            "PublicDnsName": "ec2-100-26-36-220.compute-1.amazonaws.com",
+                                            "PublicIp": "100.26.36.220"
+                                        },
+                                        "Primary": true,
+                                        "PrivateDnsName": "ip-172-31-11-37.ec2.internal",
+                                        "PrivateIpAddress": "172.31.11.37"
                                     }
-                                ], 
-                                "SubnetId": "subnet-389e3d53", 
-                                "OwnerId": "619193117841", 
-                                "PrivateIpAddress": "172.31.8.154"
+                                ],
+                                "SourceDestCheck": true,
+                                "Status": "in-use",
+                                "SubnetId": "subnet-914763e7",
+                                "VpcId": "vpc-d2d616b5",
+                                "InterfaceType": "interface"
                             }
-                        ], 
-                        "SourceDestCheck": true, 
-                        "Placement": {
-                            "Tenancy": "default", 
-                            "GroupName": "", 
-                            "AvailabilityZone": "us-west-2c"
-                        }, 
-                        "Hypervisor": "xen", 
-                        "BlockDeviceMappings": [
+                        ],
+                        "RootDeviceName": "/dev/sda1",
+                        "RootDeviceType": "ebs",
+                        "SecurityGroups": [
                             {
-                                "DeviceName": "/dev/xvda", 
-                                "Ebs": {
-                                    "Status": "attached", 
-                                    "DeleteOnTermination": true, 
-                                    "VolumeId": "vol-2b047792", 
-                                    "AttachTime": {
-                                        "hour": 5, 
-                                        "__class__": "datetime", 
-                                        "month": 4, 
-                                        "second": 29, 
-                                        "microsecond": 0, 
-                                        "year": 2016, 
-                                        "day": 14, 
-                                        "minute": 17
-                                    }
-                                }
+                                "GroupName": "default",
+                                "GroupId": "sg-6c7fa917"
                             }
-                        ], 
-                        "Architecture": "x86_64", 
-                        "StateReason": {
-                            "Message": "Client.UserInitiatedShutdown: User initiated shutdown", 
-                            "Code": "Client.UserInitiatedShutdown"
-                        }, 
-                        "RootDeviceName": "/dev/xvda", 
-                        "VirtualizationType": "hvm", 
+                        ],
+                        "SourceDestCheck": true,
                         "Tags": [
                             {
-                                "Value": "Testing123", 
-                                "Key": "Testing"
-                            }, 
+                                "Key": "App",
+                                "Value": "DevX"
+                            },
+                            {
+                                "Key": "Stage",
+                                "Value": "Dev"
+                            },
                             {
-                                "Value": "CompileLambda", 
-                                "Key": "Name"
+                                "Key": "Name",
+                                "Value": "Foo"
                             }
-                        ], 
-                        "AmiLaunchIndex": 0
+                        ],
+                        "VirtualizationType": "hvm",
+                        "CpuOptions": {
+                            "CoreCount": 1,
+                            "ThreadsPerCore": 2
+                        },
+                        "CapacityReservationSpecification": {
+                            "CapacityReservationPreference": "open"
+                        },
+                        "HibernationOptions": {
+                            "Configured": false
+                        }
                     }
-                ]
+                ],
+                "OwnerId": "644160558196",
+                "ReservationId": "r-02b0823521eeb99df"
             }
-        ], 
+        ],
         "ResponseMetadata": {
-            "HTTPStatusCode": 200, 
-            "RequestId": "6bcf1fb2-d8fb-4844-8422-106e80951a6c"
+            "RequestId": "e36ef3d7-cdeb-4f48-92a4-70081f9748ed",
+            "HTTPStatusCode": 200,
+            "HTTPHeaders": {
+                "content-type": "text/xml;charset=UTF-8",
+                "content-length": "7884",
+                "vary": "accept-encoding",
+                "date": "Tue, 11 Jun 2019 21:15:10 GMT",
+                "server": "AmazonEC2"
+            },
+            "RetryAttempts": 0
         }
     }
 }
\ No newline at end of file
diff --git a/tests/data/placebo/test_ec2_snapshot/ec2.DescribeSnapshots_1.json b/tests/data/placebo/test_ec2_snapshot/ec2.DescribeSnapshots_1.json
new file mode 100644
--- /dev/null
+++ b/tests/data/placebo/test_ec2_snapshot/ec2.DescribeSnapshots_1.json
@@ -0,0 +1,121 @@
+{
+    "status_code": 200,
+    "data": {
+        "Snapshots": [
+            {
+                "Description": "",
+                "Encrypted": false,
+                "OwnerId": "644160558196",
+                "Progress": "99%",
+                "SnapshotId": "snap-02b46f92846a4be3a",
+                "StartTime": {
+                    "__class__": "datetime",
+                    "year": 2019,
+                    "month": 6,
+                    "day": 11,
+                    "hour": 21,
+                    "minute": 15,
+                    "second": 27,
+                    "microsecond": 936000
+                },
+                "State": "pending",
+                "VolumeId": "vol-05117418b3ad30481",
+                "VolumeSize": 8,
+                "Tags": [
+                    {
+                        "Key": "Name",
+                        "Value": "Foo"
+                    },
+                    {
+                        "Key": "App",
+                        "Value": "DevX"
+                    },
+                    {
+                        "Key": "Stage",
+                        "Value": "Dev"
+                    }
+                ]
+            },
+            {
+                "Description": "",
+                "Encrypted": false,
+                "OwnerId": "644160558196",
+                "Progress": "99%",
+                "SnapshotId": "snap-041502e4149c93d23",
+                "StartTime": {
+                    "__class__": "datetime",
+                    "year": 2019,
+                    "month": 6,
+                    "day": 11,
+                    "hour": 21,
+                    "minute": 15,
+                    "second": 27,
+                    "microsecond": 936000
+                },
+                "State": "pending",
+                "VolumeId": "vol-0188a91cfcb95c342",
+                "VolumeSize": 8,
+                "Tags": [
+                    {
+                        "Key": "App",
+                        "Value": "DevX"
+                    },
+                    {
+                        "Key": "Name",
+                        "Value": "Foo"
+                    },
+                    {
+                        "Key": "Stage",
+                        "Value": "Dev"
+                    }
+                ]
+            },
+            {
+                "Description": "",
+                "Encrypted": false,
+                "OwnerId": "644160558196",
+                "Progress": "0%",
+                "SnapshotId": "snap-0e0c7752f8351db03",
+                "StartTime": {
+                    "__class__": "datetime",
+                    "year": 2019,
+                    "month": 6,
+                    "day": 11,
+                    "hour": 21,
+                    "minute": 15,
+                    "second": 27,
+                    "microsecond": 936000
+                },
+                "State": "pending",
+                "VolumeId": "vol-0caf24c45a8aa4b11",
+                "VolumeSize": 8,
+                "Tags": [
+                    {
+                        "Key": "Name",
+                        "Value": "Foo"
+                    },
+                    {
+                        "Key": "App",
+                        "Value": "DevX"
+                    },
+                    {
+                        "Key": "Stage",
+                        "Value": "Dev"
+                    }
+                ]
+            }
+        ],
+        "ResponseMetadata": {
+            "RequestId": "dc83d5e4-52d7-48c9-93a5-d1b92529513c",
+            "HTTPStatusCode": 200,
+            "HTTPHeaders": {
+                "content-type": "text/xml;charset=UTF-8",
+                "content-length": "2767",
+                "vary": "accept-encoding",
+                "date": "Tue, 11 Jun 2019 21:15:27 GMT",
+                "server": "AmazonEC2"
+            },
+            "RetryAttempts": 0
+        }
+    }
+}
\ No newline at end of file
diff --git a/tests/data/placebo/test_ec2_snapshot_copy_tags/ec2.CreateSnapshots_1.json b/tests/data/placebo/test_ec2_snapshot_copy_tags/ec2.CreateSnapshots_1.json
new file mode 100644
--- /dev/null
+++ b/tests/data/placebo/test_ec2_snapshot_copy_tags/ec2.CreateSnapshots_1.json
@@ -0,0 +1,121 @@
+{
+    "status_code": 200,
+    "data": {
+        "Snapshots": [
+            {
+                "Description": "",
+                "Tags": [
+                    {
+                        "Key": "Stage",
+                        "Value": "Dev"
+                    },
+                    {
+                        "Key": "custodian_snapshot",
+                        "Value": ""
+                    },
+                    {
+                        "Key": "Name",
+                        "Value": "Foo"
+                    }
+                ],
+                "Encrypted": false,
+                "VolumeId": "vol-0caf24c45a8aa4b11",
+                "State": "pending",
+                "VolumeSize": 8,
+                "StartTime": {
+                    "__class__": "datetime",
+                    "year": 2019,
+                    "month": 6,
+                    "day": 11,
+                    "hour": 21,
+                    "minute": 25,
+                    "second": 25,
+                    "microsecond": 0
+                },
+                "Progress": "",
+                "OwnerId": "644160558196",
+                "SnapshotId": "snap-07187bfeb49818609"
+            },
+            {
+                "Description": "",
+                "Tags": [
+                    {
+                        "Key": "Stage",
+                        "Value": "Dev"
+                    },
+                    {
+                        "Key": "custodian_snapshot",
+                        "Value": ""
+                    },
+                    {
+                        "Key": "Name",
+                        "Value": "Foo"
+                    }
+                ],
+                "Encrypted": false,
+                "VolumeId": "vol-05117418b3ad30481",
+                "State": "pending",
+                "VolumeSize": 8,
+                "StartTime": {
+                    "__class__": "datetime",
+                    "year": 2019,
+                    "month": 6,
+                    "day": 11,
+                    "hour": 21,
+                    "minute": 25,
+                    "second": 25,
+                    "microsecond": 0
+                },
+                "Progress": "",
+                "OwnerId": "644160558196",
+                "SnapshotId": "snap-051cf33e858fe7bf7"
+            },
+            {
+                "Description": "",
+                "Tags": [
+                    {
+                        "Key": "Stage",
+                        "Value": "Dev"
+                    },
+                    {
+                        "Key": "custodian_snapshot",
+                        "Value": ""
+                    },
+                    {
+                        "Key": "Name",
+                        "Value": "Foo"
+                    }
+                ],
+                "Encrypted": false,
+                "VolumeId": "vol-0188a91cfcb95c342",
+                "State": "pending",
+                "VolumeSize": 8,
+                "StartTime": {
+                    "__class__": "datetime",
+                    "year": 2019,
+                    "month": 6,
+                    "day": 11,
+                    "hour": 21,
+                    "minute": 25,
+                    "second": 25,
+                    "microsecond": 0
+                },
+                "Progress": "",
+                "OwnerId": "644160558196",
+                "SnapshotId": "snap-04589ad9a763d4cfd"
+            }
+        ],
+        "ResponseMetadata": {
+            "RequestId": "9d4ac018-d955-4993-823c-f37223b689a6",
+            "HTTPStatusCode": 200,
+            "HTTPHeaders": {
+                "content-type": "text/xml;charset=UTF-8",
+                "transfer-encoding": "chunked",
+                "vary": "accept-encoding",
+                "date": "Tue, 11 Jun 2019 21:25:24 GMT",
+                "server": "AmazonEC2"
+            },
+            "RetryAttempts": 0
+        }
+    }
+}
\ No newline at end of file
diff --git a/tests/data/placebo/test_ec2_snapshot_copy_tags/ec2.DescribeInstances_1.json b/tests/data/placebo/test_ec2_snapshot_copy_tags/ec2.DescribeInstances_1.json
new file mode 100644
--- /dev/null
+++ b/tests/data/placebo/test_ec2_snapshot_copy_tags/ec2.DescribeInstances_1.json
@@ -0,0 +1,212 @@
+{
+    "status_code": 200,
+    "data": {
+        "Reservations": [
+            {
+                "Groups": [],
+                "Instances": [
+                    {
+                        "AmiLaunchIndex": 0,
+                        "ImageId": "ami-07b4156579ea1d7ba",
+                        "InstanceId": "i-063c6794763254b51",
+                        "InstanceType": "t3.small",
+                        "LaunchTime": {
+                            "__class__": "datetime",
+                            "year": 2019,
+                            "month": 6,
+                            "day": 11,
+                            "hour": 20,
+                            "minute": 56,
+                            "second": 23,
+                            "microsecond": 0
+                        },
+                        "Monitoring": {
+                            "State": "disabled"
+                        },
+                        "Placement": {
+                            "AvailabilityZone": "us-east-1a",
+                            "GroupName": "",
+                            "Tenancy": "default"
+                        },
+                        "PrivateDnsName": "ip-172-31-11-37.ec2.internal",
+                        "PrivateIpAddress": "172.31.11.37",
+                        "ProductCodes": [],
+                        "PublicDnsName": "ec2-100-26-36-220.compute-1.amazonaws.com",
+                        "PublicIpAddress": "100.26.36.220",
+                        "State": {
+                            "Code": 16,
+                            "Name": "running"
+                        },
+                        "StateTransitionReason": "",
+                        "SubnetId": "subnet-914763e7",
+                        "VpcId": "vpc-d2d616b5",
+                        "Architecture": "x86_64",
+                        "BlockDeviceMappings": [
+                            {
+                                "DeviceName": "/dev/sda1",
+                                "Ebs": {
+                                    "AttachTime": {
+                                        "__class__": "datetime",
+                                        "year": 2019,
+                                        "month": 6,
+                                        "day": 11,
+                                        "hour": 20,
+                                        "minute": 56,
+                                        "second": 23,
+                                        "microsecond": 0
+                                    },
+                                    "DeleteOnTermination": true,
+                                    "Status": "attached",
+                                    "VolumeId": "vol-0caf24c45a8aa4b11"
+                                }
+                            },
+                            {
+                                "DeviceName": "/dev/sdb",
+                                "Ebs": {
+                                    "AttachTime": {
+                                        "__class__": "datetime",
+                                        "year": 2019,
+                                        "month": 6,
+                                        "day": 11,
+                                        "hour": 20,
+                                        "minute": 56,
+                                        "second": 23,
+                                        "microsecond": 0
+                                    },
+                                    "DeleteOnTermination": true,
+                                    "Status": "attached",
+                                    "VolumeId": "vol-0188a91cfcb95c342"
+                                }
+                            },
+                            {
+                                "DeviceName": "/dev/sdc",
+                                "Ebs": {
+                                    "AttachTime": {
+                                        "__class__": "datetime",
+                                        "year": 2019,
+                                        "month": 6,
+                                        "day": 11,
+                                        "hour": 20,
+                                        "minute": 56,
+                                        "second": 23,
+                                        "microsecond": 0
+                                    },
+                                    "DeleteOnTermination": true,
+                                    "Status": "attached",
+                                    "VolumeId": "vol-05117418b3ad30481"
+                                }
+                            }
+                        ],
+                        "ClientToken": "",
+                        "EbsOptimized": true,
+                        "EnaSupport": true,
+                        "Hypervisor": "xen",
+                        "NetworkInterfaces": [
+                            {
+                                "Association": {
+                                    "IpOwnerId": "amazon",
+                                    "PublicDnsName": "ec2-100-26-36-220.compute-1.amazonaws.com",
+                                    "PublicIp": "100.26.36.220"
+                                },
+                                "Attachment": {
+                                    "AttachTime": {
+                                        "__class__": "datetime",
+                                        "year": 2019,
+                                        "month": 6,
+                                        "day": 11,
+                                        "hour": 20,
+                                        "minute": 56,
+                                        "second": 23,
+                                        "microsecond": 0
+                                    },
+                                    "AttachmentId": "eni-attach-0125cf6988c1ec962",
+                                    "DeleteOnTermination": true,
+                                    "DeviceIndex": 0,
+                                    "Status": "attached"
+                                },
+                                "Description": "",
+                                "Groups": [
+                                    {
+                                        "GroupName": "default",
+                                        "GroupId": "sg-6c7fa917"
+                                    }
+                                ],
+                                "Ipv6Addresses": [],
+                                "MacAddress": "0a:9f:f7:9f:2d:24",
+                                "NetworkInterfaceId": "eni-00eb9a1bebb7a0d0c",
+                                "OwnerId": "644160558196",
+                                "PrivateDnsName": "ip-172-31-11-37.ec2.internal",
+                                "PrivateIpAddress": "172.31.11.37",
+                                "PrivateIpAddresses": [
+                                    {
+                                        "Association": {
+                                            "IpOwnerId": "amazon",
+                                            "PublicDnsName": "ec2-100-26-36-220.compute-1.amazonaws.com",
+                                            "PublicIp": "100.26.36.220"
+                                        },
+                                        "Primary": true,
+                                        "PrivateDnsName": "ip-172-31-11-37.ec2.internal",
+                                        "PrivateIpAddress": "172.31.11.37"
+                                    }
+                                ],
+                                "SourceDestCheck": true,
+                                "Status": "in-use",
+                                "SubnetId": "subnet-914763e7",
+                                "VpcId": "vpc-d2d616b5",
+                                "InterfaceType": "interface"
+                            }
+                        ],
+                        "RootDeviceName": "/dev/sda1",
+                        "RootDeviceType": "ebs",
+                        "SecurityGroups": [
+                            {
+                                "GroupName": "default",
+                                "GroupId": "sg-6c7fa917"
+                            }
+                        ],
+                        "SourceDestCheck": true,
+                        "Tags": [
+                            {
+                                "Key": "App",
+                                "Value": "DevX"
+                            },
+                            {
+                                "Key": "Stage",
+                                "Value": "Dev"
+                            },
+                            {
+                                "Key": "Name",
+                                "Value": "Foo"
+                            }
+                        ],
+                        "VirtualizationType": "hvm",
+                        "CpuOptions": {
+                            "CoreCount": 1,
+                            "ThreadsPerCore": 2
+                        },
+                        "CapacityReservationSpecification": {
+                            "CapacityReservationPreference": "open"
+                        },
+                        "HibernationOptions": {
+                            "Configured": false
+                        }
+                    }
+                ],
+                "OwnerId": "644160558196",
+                "ReservationId": "r-02b0823521eeb99df"
+            }
+        ],
+        "ResponseMetadata": {
+            "RequestId": "14be9317-ea43-4a62-9949-a7c36e6f5cc6",
+            "HTTPStatusCode": 200,
+            "HTTPHeaders": {
+                "content-type": "text/xml;charset=UTF-8",
+                "content-length": "7884",
+                "vary": "accept-encoding",
+                "date": "Tue, 11 Jun 2019 21:25:23 GMT",
+                "server": "AmazonEC2"
+            },
+            "RetryAttempts": 0
+        }
+    }
+}
\ No newline at end of file
diff --git a/tests/data/placebo/test_ec2_snapshot_copy_tags/ec2.DescribeSnapshots_1.json b/tests/data/placebo/test_ec2_snapshot_copy_tags/ec2.DescribeSnapshots_1.json
new file mode 100644
--- /dev/null
+++ b/tests/data/placebo/test_ec2_snapshot_copy_tags/ec2.DescribeSnapshots_1.json
@@ -0,0 +1,121 @@
+{
+    "status_code": 200,
+    "data": {
+        "Snapshots": [
+            {
+                "Description": "",
+                "Encrypted": false,
+                "OwnerId": "644160558196",
+                "Progress": "99%",
+                "SnapshotId": "snap-051cf33e858fe7bf7",
+                "StartTime": {
+                    "__class__": "datetime",
+                    "year": 2019,
+                    "month": 6,
+                    "day": 11,
+                    "hour": 21,
+                    "minute": 25,
+                    "second": 25,
+                    "microsecond": 343000
+                },
+                "State": "pending",
+                "VolumeId": "vol-05117418b3ad30481",
+                "VolumeSize": 8,
+                "Tags": [
+                    {
+                        "Key": "custodian_snapshot",
+                        "Value": ""
+                    },
+                    {
+                        "Key": "Name",
+                        "Value": "Foo"
+                    },
+                    {
+                        "Key": "Stage",
+                        "Value": "Dev"
+                    }
+                ]
+            },
+            {
+                "Description": "",
+                "Encrypted": false,
+                "OwnerId": "644160558196",
+                "Progress": "99%",
+                "SnapshotId": "snap-04589ad9a763d4cfd",
+                "StartTime": {
+                    "__class__": "datetime",
+                    "year": 2019,
+                    "month": 6,
+                    "day": 11,
+                    "hour": 21,
+                    "minute": 25,
+                    "second": 25,
+                    "microsecond": 343000
+                },
+                "State": "pending",
+                "VolumeId": "vol-0188a91cfcb95c342",
+                "VolumeSize": 8,
+                "Tags": [
+                    {
+                        "Key": "Name",
+                        "Value": "Foo"
+                    },
+                    {
+                        "Key": "Stage",
+                        "Value": "Dev"
+                    },
+                    {
+                        "Key": "custodian_snapshot",
+                        "Value": ""
+                    }
+                ]
+            },
+            {
+                "Description": "",
+                "Encrypted": false,
+                "OwnerId": "644160558196",
+                "Progress": "99%",
+                "SnapshotId": "snap-07187bfeb49818609",
+                "StartTime": {
+                    "__class__": "datetime",
+                    "year": 2019,
+                    "month": 6,
+                    "day": 11,
+                    "hour": 21,
+                    "minute": 25,
+                    "second": 25,
+                    "microsecond": 343000
+                },
+                "State": "pending",
+                "VolumeId": "vol-0caf24c45a8aa4b11",
+                "VolumeSize": 8,
+                "Tags": [
+                    {
+                        "Key": "Name",
+                        "Value": "Foo"
+                    },
+                    {
+                        "Key": "custodian_snapshot",
+                        "Value": ""
+                    },
+                    {
+                        "Key": "Stage",
+                        "Value": "Dev"
+                    }
+                ]
+            }
+        ],
+        "ResponseMetadata": {
+            "RequestId": "bf1af141-c6f7-41eb-b622-b1304854e161",
+            "HTTPStatusCode": 200,
+            "HTTPHeaders": {
+                "content-type": "text/xml;charset=UTF-8",
+                "content-length": "2780",
+                "vary": "accept-encoding",
+                "date": "Tue, 11 Jun 2019 21:25:25 GMT",
+                "server": "AmazonEC2"
+            },
+            "RetryAttempts": 0
+        }
+    }
+}
\ No newline at end of file
diff --git a/tests/test_ec2.py b/tests/test_ec2.py
--- a/tests/test_ec2.py
+++ b/tests/test_ec2.py
@@ -994,34 +994,98 @@ def test_ec2_or_condition(self):
 
 class TestSnapshot(BaseTest):
 
-    def test_ec2_snapshot_no_copy_tags(self):
+    def test_ec2_snapshot_error_process_set(self):
+        p = self.load_policy({
+            'name': 'ec2-test-snapshot', "resource": "ec2",
+            "actions": [{"type": "snapshot"}]})
+        snapshotter = p.resource_manager.actions[0]
+
+        def process_volume_set(client, resource):
+            raise ValueError('something bad happened')
+
+        snapshotter.process_volume_set = process_volume_set
+        log = self.capture_logging('custodian.actions')
+        self.assertRaises(
+            ValueError, snapshotter.process, [{'InstanceId': 'xyz'}])
+        self.assertTrue('something' in log.getvalue())
+
+    def test_ec2_snapshot_error_process_once(self):
+        p = self.load_policy({
+            'name': 'ec2-test-snapshot', "resource": "ec2",
+            "actions": [{"type": "snapshot"}]})
+
+        log = self.capture_logging('custodian.actions')
+        snapshotter = p.resource_manager.actions[0]
+        client = mock.Mock(['create_snapshots'])
+        err_response = {'Error': {'Code': 'InvalidInstanceId.NotFound'}}
+        err = ClientError(err_response, 'create_snapshots')
+        client.create_snapshots.side_effect = err
+        snapshotter.process_volume_set(client, {'InstanceId': 'i-foo'})
+        client.create_snapshots.assert_called_once()
+
+        self.assertTrue('i-foo' in log.getvalue())
+        err_response['Error']['Code'] = 'InvalidRequest'
+        self.assertRaises(
+            ClientError,
+            snapshotter.process_volume_set,
+            client, {'InstanceId': 'i-foo'})
+
+    def test_ec2_snapshot_validate(self):
+        templ = {
+            "name": "ec2-test-snapshot",
+            "resource": "ec2",
+            "filters": [{"tag:Name": "CompileLambda"}],
+            "actions": [{"type": "snapshot"}]}
+
+        self.load_policy(templ)
+        templ['actions'][0]['copy-volume-tags'] = False
+        self.load_policy(templ)
+        templ['actions'][0]['copy-tags'] = ['Name']
+        self.assertRaises(PolicyValidationError, self.load_policy, templ)
+
+    def test_ec2_snapshot_copy_instance_tags_default(self):
         session_factory = self.replay_flight_data("test_ec2_snapshot")
         policy = self.load_policy(
             {
                 "name": "ec2-test-snapshot",
                 "resource": "ec2",
-                "filters": [{"tag:Name": "CompileLambda"}],
-                "actions": [{"type": "snapshot"}],
+                "filters": [{"tag:Name": "Foo"}],
+                "actions": [{"type": "snapshot"}]
             },
             session_factory=session_factory,
         )
         resources = policy.run()
         self.assertEqual(len(resources), 1)
+        client = session_factory().client('ec2')
+        snaps = client.describe_snapshots(
+            SnapshotIds=resources[0]['c7n:snapshots']).get('Snapshots')
+        rtags = {t['Key']: t['Value'] for t in resources[0]['Tags']}
+        for s in snaps:
+            self.assertEqual(rtags, {t['Key']: t['Value'] for t in s['Tags']})
 
     def test_ec2_snapshot_copy_tags(self):
-        session_factory = self.replay_flight_data("test_ec2_snapshot")
+        session_factory = self.replay_flight_data("test_ec2_snapshot_copy_tags")
         policy = self.load_policy(
             {
                 "name": "ec2-test-snapshot",
                 "resource": "ec2",
-                "filters": [{"tag:Name": "CompileLambda"}],
-                "actions": [{"type": "snapshot", "copy-tags": ["ASV" "Testing123"]}],
+                "filters": [{"tag:Name": "Foo"}],
+                "actions": [{"type": "snapshot", "copy-tags": ['Name', 'Stage']}]
             },
             session_factory=session_factory,
         )
         resources = policy.run()
         self.assertEqual(len(resources), 1)
 
+        client = session_factory().client('ec2')
+        snaps = client.describe_snapshots(
+            SnapshotIds=resources[0]['c7n:snapshots']).get('Snapshots')
+        rtags = {t['Key']: t['Value'] for t in resources[0]['Tags']}
+        rtags.pop('App')
+        rtags['custodian_snapshot'] = ''
+        for s in snaps:
+            self.assertEqual(rtags, {t['Key']: t['Value'] for t in s['Tags']})
+
 
 class TestSetInstanceProfile(BaseTest):