【问题标题】:Is there a way to find the GCP VM startup script's return code有没有办法找到 GCP VM 启动脚本返回码
【发布时间】:2018-09-22 16:57:40
【问题描述】:

我有与 Compute Engine 虚拟机关联的启动脚本。我想知道是否有办法找出这些启动脚本的返回码。我目前跟踪串口日志以检查返回码。但是,还有其他地方可以查到吗?

gcloud compute instances tail-serial-port-output compute-vm-1 \
    --project=gcp-project-hw1 --zone=us-central1-a | egrep "Return code "

【问题讨论】:

  • 这个问题在这里看起来离题了。为什么不使用 systemd 的 systemctl 之类的方法检查返回码?
  • 很好奇为什么你会觉得这是题外话..

标签: linux unix google-cloud-platform google-compute-engine


【解决方案1】:

返回码在 VM 内,使用串口只是为您提供来自 VM 的反馈,并允许您在不连接到实例的情况下查看此信息。串口是查找响应码的唯一途径,无需直接访问虚拟机

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-16
    • 2021-02-03
    • 2021-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-21
    • 2020-09-30
    相关资源
    最近更新 更多