Nhiều lần gặp tình huống NFS datastore trên host VMWare ESXi trở nên unavailable/inactive và bị xám trong danh sách storage của host. Tuy nhiên, NFS storage vẫn khả dụng ở cấp độ mạng. Thường giải quyết bằng cách xóa NFS storage và thêm lại.
Tuy nhiên, khi cố gắng xóa NFS storage inactive đó khỏi cấu hình ESXi host, nó trả về lỗi:
The resource datastore_nfs02 is in use.
Call "HostDatastoreSystem.RemoveDatastore" form object "datastoreSystem-28" on vCenter Server "xxxx" failed.
CannotRemove datastore 'datastore_name' because Storage I/O control is enabled on it. Correct it and re-try the operation
Dựa trên lỗi, NFS storage không thể xóa do Storage I/O control (SIOC) đang bật. Nếu tắt nó, lỗi khác xuất hiện:
Datastore is not accessible
Giải pháp
Để xóa đúng NFS storage từ host VMWare ESXi, phải kết nối trực tiếp ESXi host server qua SSH (có thể bật SSH từ vSphere Client).
Hiển thị danh sách NFS storage trong hệ thống:
esxcli storage nfs list |
Lệnh tương tự trên ESXi 4.x:
esxcfg-nas -l |
Để unmount NFS storage:
esxcli storage nfs remove –v datastore_nfs02 |
Trên ESXi 4.x lệnh như sau:
esxcfg-nas -d datastore_nfs02 |
Lưu ý. Nếu tên NFS storage chứa dấu cách, phải đặt trong ngoặc kép.
Nếu NFS datastore không bị xóa khỏi vSphere Client, nhấn nút Refresh trong phần ESXi storage (Configuration → Storage).
Lưu ý. Phải làm trên mọi ESXi host cần xóa storage inactive.