0

I created a TPU-VM instance (not a normal compute instance) and attach an external disk to it using this command:

 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]

Now I want to detach that disk from the TPU-VM but I cannot find the instance in the VM instances tab in the Google cloud console (They treated it as a TPU instance so it's not listed there). I can only find it in the TPUs tab, but in the TPUs tab I cannot edit the disk out of the instance.

I tried using this command too but it doesn't work:

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

It says that resource (projects/project-name/zone/instances/tpu-vm-name) was not found.

2 Answers2

0

Detaching a disk for the TPU VM architecture is not supported right now.

Allen Wang
  • 281
  • 1
  • 4
0

Actually, it is supported according to this tutorial! You need to follow this config when you are in TPU VM.Don't forget creating disk before detaching it and be sure you are using same billing account in both TPU VM and Disk. Otherwise, system will throw 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