Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.5k views
in Technique[技术] by (71.8m points)

google cloud platform - GCP Startup script is not executed

For a GCP VM (RHEL-7) I have configured (added to custom metadata section on GCP console under startup-script key) scripts like:

echo "Welcome"

During the VM restart the scripts seems not triggered. When I SSH to the VM and run

sudo google_metadata_script_runner startup

In logs I have the following output:

GCEMetadataScripts[11176]: 2021/01/12 19:10:10 GCEMetadataScripts: Starting startup scripts (version 20200706.00). 
GCEMetadataScripts[11176]: 2021/01/12 19:10:10 GCEMetadataScripts: Found startup-script in metadata. GCEMetadataScripts[11176]: 2021/01/12 19:10:10 
GCEMetadataScripts: startup-script: /bin/bash: /tmp/metadata-scripts171057037/startup-script: Permission denied
GCEMetadataScripts[11176]: 2021/01/12 19:10:10 GCEMetadataScripts: startup-script exit status 126
GCEMetadataScripts[11176]: 2021/01/12 19:10:10 GCEMetadataScripts: Finished running startup scripts.

Does anyone have any idea how to fix that?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...