schedviz
schedviz copied to clipboard
Make gcloud_trace.sh script work on Google COS
I tried to run the gcloud_trace.sh against a COS instance.
It failed as follows:
$ ./gcloud_trace.sh -instance myinstance -ta "-cs 1"
Uploading trace script to myinstance
trace.sh 100% 4536 6.3MB/s 00:00
Collecting trace on myinstance
sudo: unable to execute /tmp/trace.sh: Permission denied
Downloading recorded trace from myinstance
scp: /tmp/trace/trace.tar.gz: No such file or directory
ERROR: (gcloud.compute.scp) [/usr/bin/scp] exited with return code [1].
because /tmp is mounted as noexec by design:
$ mount | grep /tmp
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noexec)
Possible fixes:
a) allow to configure the remote directory for trace.sh via argument of gcloud_trace.sh
b) detect COS nodes and automatically choose a dir without noexec
c) detect COS nodes and run the trace.sh inside a toolbox.