Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.6k 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...