【问题标题】:How to detach a disk in a Google Cloud TPU VM instance?如何分离 Google Cloud TPU VM 实例中的磁盘?
【发布时间】:2021-09-30 08:33:00
【问题描述】:

我创建了一个 TPU-VM 实例(不是普通的计算实例)并使用以下命令将外部磁盘附加到它:

 gcloud alpha compute tpus tpu-vm create TPU-VM-NAME \
  --zone=europe-west4-a \
  --accelerator-type=v3-8 \
  --version=v2-alpha \
  --data-disk source=[PATH/TO/DISK]

现在我想将该磁盘与 TPU-VM 分离,但我无法在 Google 云控制台的 VM 实例选项卡中找到该实例(他们将其视为 TPU 实例,因此未在此处列出)。我只能在 TPU 选项卡中找到它,但在 TPU 选项卡中我无法从实例中编辑磁盘。

我也尝试过使用这个命令,但它不起作用:

gcloud compute instances detach-disk INSTANCE-NAME --disk=DISK-NAME

它说找不到资源 (projects/project-name/zone/instances/tpu-vm-name)。

【问题讨论】:

  • 您是否尝试过使用 CLI 的 alpha 版本?
  • 我试过gcloud alpha compute instances detach-disk,但它显示同样的错误,找不到资源。
  • 您是否在项目的磁盘列表中看到该磁盘?
  • 是的,我在 TPU VM 之前为其他一些计算实例创建了磁盘。可以分离磁盘列表中的磁盘吗?

标签: google-cloud-platform google-cloud-storage google-cloud-tpu


【解决方案1】:

其实是按照这个tutorial支持的!当您在 TPU VM 中时,您需要遵循此配置。不要忘记在分离之前创建磁盘,并确保您在 TPU VM 和磁盘中使用相同的计费帐户。否则系统会抛出INTERNAL ERROR。

sudo lsblk

#Find the disk here, and the device name. Most likely it will be "sdb". Given that is correct, format the disk with this command: 
sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/sdb

#Mount the disk - and give everyone 
sudo mkdir -p /mnt/disks/flaxdisk
sudo mount -o discard,defaults /dev/sdb /mnt/disks/flaxdisk
sudo chmod a+w /mnt/disks/flaxdisk

#Configure automatic mount on restarts
sudo cp /etc/fstab /etc/fstab.backup

#Find the uid of the disk - you need this value in the following steps
sudo blkid /dev/sdb

#Add this to /etc/fstab with the correct uuid
UUID=52af08e4-f249-4efa-9aa3-7c7a9fd560b0 /mnt/disks/flaxdisk ext4 discard,defaults,nofail 0 2

【讨论】:

    【解决方案2】:

    目前不支持为 TPU VM 架构分离磁盘。

    【讨论】:

    • 谢谢。然后我可能不得不克隆磁盘以将其附加到另一台机器上。
    猜你喜欢
    • 2022-11-16
    • 1970-01-01
    • 1970-01-01
    • 2018-12-23
    • 2015-12-07
    • 2020-04-30
    • 2017-10-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多