- In the Cloud Console, add the following roles to the service account you are using for this tutorial. For more information, read Granting, changing, and revoking access to resources
- Go to the IAM page
- Compute Instance Admin (v1)
- Compute Network Admin
- Compute Security Admin
- Service Account User
- Storage Admin
- Storage Object Admin
- In the Cloud Console, open Cloud Shell : OPEN Cloud Shell
Now we will be doing the following to delete everything related to a Elastifile cluster :
- Remove all storage nodes and EMS nodes from the ECFS cluster
- Delete the Firewall Rules associated with Instances.
- Delete the Network Routes associated with Instances.
Remove above mentioned resources from UI
Please find the instances from the UI that you want to delete and disable the delete-protection using the GUI and then proceed to delete them one by one.
After you have deleted the instances, you can move to firewall rules and search the connected firewall rules using the filter GUI. Please delete them one-by-one.
After that you can delete the network routes, search for the connected routes using EMS details and then delete them.
Please be extremely careful in which resource you are deleting as this is a non-recoverable step and anything deleted will not be restored.
At the end of document, are the various references to delete the above resources using command line and the commands are mentioned in detail :
One example is :
gcloud compute instances list --filter="labels.cluster-hash:$CLUSTERHASH" --project $PROJECT
Here you need to replace $PROJECT and $CLUSTERHASH with respective values and it should list the instances you need to delete, After which you can run :
gcloud compute instances update $i --no-deletion-protection --project $PROJECT
Here you need to replace $i and $PROJECT with respective values and it should disable delete protection on the instances you need to delete, After which you can run :
gcloud -q compute instances delete $i --delete-disks=all --project $PROJECT
Which should delete the instances and the disks along with it. After which you can delete the firewalls and routes in a similiar manner.
The commands are mentioned in detail in following links :
- Firewall-rules Delete SDK : gcloud compute firewall-rules delete | Cloud SDK Documentation
- Firewall-rules List SDK : gcloud compute firewall-rules list | Cloud SDK Documentation
- Route Link SDK : gcloud compute routes list | Cloud SDK Documentation
- Route Delete SDK : gcloud compute routes delete | Cloud SDK Documentation
- Filters SDK : gcloud topic filters | Cloud SDK Documentation
- List SDK gcloud compute instances list | Cloud SDK Documentation
Please contact Google Elastifile support at https://support.elastifile.com if you need any further help.