描述卷中的ec2-automate-backup错误

时间:2015-07-03 11:14:08

标签: amazon-web-services amazon-ec2 ec2-api-tools

尝试运行ec2-automate-backup-awscli.sh时出错。我看到https://github.com/colinbjohnson/aws-missing-tools/issues/88描述了类似的问题,但我使用的是cron-primer.sh.aws文件,但仍然出现此错误。这是我得到的输出。

ec2-user:~/scripts/ec2-automate-backup$ ./ec2-automate-backup-awscli.sh -v "vol-07e1a916" -c ./cron-primer.sh

A client error (InvalidVolume.NotFound) occurred when calling the DescribeVolumes operation: The volume 'vol-07e1a916' does not exist.
An error occurred when running ec2-describe-volumes. The error returned is below:
<nothing here>

但是当我运行aws ec2 describe-volumes时,我可以看到音量。

ec2-user:~/scripts/ec2-automate-backup$  aws ec2 describe-volumes
{
    "Volumes": [
        {
            "AvailabilityZone": "us-west-2a", 
            "Attachments": [
                {
                    "AttachTime": "2015-02-25T01:34:00.000Z", 
                    "InstanceId": "i-da56b1d7", 
                    "VolumeId": "vol-07e1a916", 
                    "State": "attached", 
                    "DeleteOnTermination": false, 
                    "Device": "/dev/xvda"
                }
            ], 
            "Tags": [
                {
                    "Value": "true", 
                    "Key": "Backup-Daily"
                }
            ], 
            "Encrypted": false, 
            "VolumeType": "gp2", 
            "VolumeId": "vol-07e1a916", 
            "State": "in-use", 
            "Iops": 24, 
            "SnapshotId": "snap-f518b274", 
            "CreateTime": "2015-02-25T01:34:00.281Z", 
            "Size": 8
        }
    ]
}

1 个答案:

答案 0 :(得分:3)

我通过在命令行中显式设置区域来解决这个问题。

ec2-user:~/scripts/ec2-automate-backup$ ./ec2-automate-backup-awscli.sh -v "vol-07e1a916" -c ./cron-primer.sh -r "us-west-2"