【问题标题】:Cannot access GCP VM instance无法访问 GCP 虚拟机实例
【发布时间】:2021-08-19 05:13:43
【问题描述】:

过去几天我一直在尝试连接到 VM 实例。这是我尝试过的:

  • 尝试通过 SSH 访问它会返回 username@ipaddress: Permission denied (publickey).
  • 使用 Google Cloud SDK 会返回:
    No zone specified. Using zone [us-central1-a] for instance: [instancename].
    
    Updating project ssh metadata...done.
    Waiting for SSH key to propagate.
    SFATAL ERROR: No supported authentication methods available (server sent: publickey)
    ERROR: (gcloud.compute.ssh) Could not SSH into the instance.  It is possible that your SSH key has not propagated to theinstance yet. Try running this command again.  If you still cannot connect, verify that the firewall and instance are set to accept ssh traffic.
    
  • 使用浏览器SSH just gets stuck on "Transferring SSH keys to the VM."
  • 使用 PuTTy 也会导致 No supported authentication methods available (server sent: publickey)

我检查了串行控制台,发现:

systemd-hostnamed.service: Failed to run 'start' task: No space left on device

我最近确实调整了磁盘大小并重新启动了 VM,但仍然出现此错误。

访问端口 22 is allowed in the firewall rules。我该怎么做才能解决这个问题?

【问题讨论】:

  • 您好!看看Troubleshooting SSH 页面。尝试按照 Google 的有关如何对 SSH 进行故障排除的指南进行操作。如果您按照指南操作仍无法访问您的虚拟机,请与我们分享;不要忘记添加您已经执行的步骤。
  • 您好!我已阅读故障排除页面并尝试启用来宾环境,但在检查串行控制台后,我看到的只是“设备上没有剩余空间”。奇怪的是,我今天早些时候将启动磁盘大小从 10 GB 增加到 16 GB,但我仍然收到此错误。

标签: google-cloud-platform ssh


【解决方案1】:

增加磁盘大小后,您需要重新启动实例,以便可以调整文件系统的大小,只是在这种特定情况下,因为您已经用完了空间。

如果您还没有这样做,请创建 VM 启动磁盘的快照。

尝试重启虚拟机。

如果仍然无法访问虚拟机,请执行以下操作:

停止虚拟机:

gcloud compute instances stop VM_NAME

将 VM_NAME 替换为您的 VM 名称。

增加启动盘大小:

gcloud compute disks resize BOOT_DISK_NAME --size DISK_SIZE

替换以下内容:

BOOT_DISK_NAME:虚拟机启动盘的名称 DISK_SIZE:新的更大的大小,以千兆字节为单位,用于启动磁盘

启动虚拟机:

gcloud compute instances start VM_NAME

重新尝试通过 SSH 连接到虚拟机。

【讨论】:

  • 我已经在调整大小后立即重启了实例,但仍然出现此问题。
  • 您的答案的编辑版本仍然没有帮助,因为我之前也尝试过
  • 目前我能看到的唯一选择是将启动磁盘附加到另一个实例并检查日志并确认这不是磁盘大小问题,而是 ssh 问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-06-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-04-08
相关资源
最近更新 更多