0

When I am running the command "gcloud beta compute disks create example-disk --csek-key-file example-file.json" to create the encrypted disk using CSEK, it fails with the following error:

ERROR: (gcloud.beta.compute.disks.create) Key required for resource [https://www .googleapis.com/compute/beta/projects/extreme-axon-162911/zones/us-east1-b/disks /example-disk], but none found. Please help me to find out the reason for failure.

  • Looks like the issue is that example-file.json doesn't have an encryption key for the disk you're trying to create. What're the contents of example-file.json (with the key material redacted, of course)? – Zachary Newman Apr 10 '17 at 14:14

2 Answers2

1

In order to resolve the issue, you will need to specify a valid value for uri. In JSON file, replace myproject with your real project ID, replace v1 with beta since you're using gcloud beta command and also make sure the zone match to the zone that you're specifying with gcloud command.

Kamran
  • 1,425
  • 7
  • 17
0

Here is the contents of json file. It has the key and I can able to create the disk when I am providing the key value in console but not using gcloud.


[ { "uri": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/example-disk", "key": "dkZCh83h78PlJ6z+fzjcm+ghgjklfVzzQtDCi3lO1qG5MbUDug4TYQl77XTktmNOjF26UuH53pRRSgpSoXbh5Pft/U/Eja781OPpBiyZ6Apd1RvD01J97nWtpnyFNNq7EZl5a/GJ7vOPrD1dilzEdkokRW4exnmFJiR9Q8E5qDTdydOo11yyFme/H6Q4ikB2xD0c/0xqP0qn2L0NxP38HBR68bmj7QhlW3MLPlQZ8XxkA6THckEPatuYemb9Q3FIcevi5KsWKCa+BOX5uBgU0wgwcPI7MpOV5OOePL1t9lE8fB4vdZp9ILgrtxOxEdHhYmZtb0vQBTJ0MFzcdL6ZG6A==", "key-type": "rsa-encrypted" }

]