Sunday, January 19, 2025

Steps to Fix VMFS Datastore unmount/Delete Error: Resource in Use

 Often while deleting an empty VMFS Datastore in VMWare vSphere you may encounter the error "Unable to unmount/delete VMFS datastore: the source is in use". What Causes VMFS Datastore Unmount/Delete Error Not Existing: Resource in Use? Often when moving VM files from old storage to a new storage system, users encounter an error message like the following:

Unmount VMFS volume vmesxi2.woshub.com. The resource 'Datastore Name: MSA2000_LUN1 VMFS uuid: xxxxx--xxxxx-x-xxxxx-xxxx' is in use. Cannot unmount volume Datastore Name VMFS “file system is busy”.

This error usually occurs when trying to disconnect VMFS Datastore from ESXi hosts. Based on the error, it is clear that VMFS data storage cannot be removed because ESXi or vSphere hosts still use storage to write some data.

According to VMWare documentation, we need to check the following points when removing LUN from vSphere:

  • There are no virtual machines, templates, snapshots, or ISO image files in the VMFS Data Store (we need to move VMs to another VMFS Datastore, turn them off and delete, or unregister VMs in vSphere).
  • Storage I/O Control is disabled for storing data
  • Datastore is not part of the Datastore Cluster
  • LUN is not used as an RDM device
  • VMFS datastore is not used to store vSphere HA data, Storage DRS, logs, dump data (/vmkdump/), vSAN data (/vsantraced/), technical support data (scratch partition), or virtual machine swap files.

How to Fix VMFS Datastore Unmount/Delete Error: Resource in Use?

Sometimes, even after moving virtual machines to a new data store, VMFS storage may still contain other files and folders. This may include a directory with log (logdir), a directory with a description of SCSI devices (sdd.sf), VMFS metadata. If ESXi host logs are still in the VMFS data store (logdir), we may need to check if the data store is specified as the location of the logs in the ESXi host settings. To do this, go to Manage -> Settings -> Advanced System Settings. Find ScratchConfig.CurrentScratchLocation and Syslog.global.logDir. If there is a VMFS data store in that path, change the path of the logs directory.

Now restart ESXi Hosting or restart the Syslog Server service on the host. Let's try to disconnect the data store from the ESXi host again. Go to Manage -> Storage -> Storage Device. Find the corresponding LUN in the list, select it, and click Detaches the Selected device from host.

Delete VMFS datastore partition table

Sometimes, even after redirecting to the report directory, the unmount operation still fails. This can be done by the following steps:

1. Connect via SSH to an ESXi host that has VMFS storage installed.
2. Copy your data store ID into the vSphere interface and check the ESXi host which device and VMFS storage path it corresponds to:

esxcfg-scsidevs -c | grep naa.6001438005df0dee0000700004be0000
naa.6001438005df0dee0000700004be0000 Direct-Access /vmfs/devices/disks/naa. 6001438005df0dee0000700004be0000 512000MB NMP HP Fibre Channel Disk (naa.6001438005df0dee0000700004be0000)
esxcfg-scsidevs -m | grep naa.6001438005df0dee0000700004be0000
naa.6001438005df0dee0000700004be0000:1 /vmfs/devices/disks/naa.6001438005df0dee0000700004be0000:1

3. Let's see how much space is occupied in the VMFS data repository:

df -h | grep MSA2000_LUN1
VMFS-5 499.8G 1.4G 498.3G 0% /vmfs/volumes/MSA2000_LUN1

4. So we have made sure that the datastore name and store ID match the LUN we want to remove.
5. Now let's check the information about the partition table in the data store:

partedUtil getptbl /vmfs/devices/disks/naa.6001438005df0dee0000700004be0000
gpt
65270 255 63 1048576000
1 2048 1048575966 AA31E02A400F11DB9590000C2911D1B8 vmfs 0

6. In this case, the LUN has a partition with the VMFS filesystem.
7. Remove VMFS partition with ID 1 from this disk (LUN).

partedUtil delete /vmfs/devices/disks/naa.6001438005df0dee0000700004be0000 1

After removing the partition, we can unmount LUN in vSphere. The "Datastore is in use" error does not appear again. In summary, the "unable to unmount/delete vmfs datastore: the resource is in use" error is generated when deleting an empty VMFS Datastore in VMWare vSphere

Comparison between VMware and Proxmox

 


VMware and Proxmox are both major players in the world of virtualization, providing robust solutions for the management and operation of virtual machines. However, there are significant differences in licensing, features, performance, and target users.

Vmware:

VMware is a virtualization business platform known for its enterprise-level features, scalability, and high performance. The platform includes a comprehensive suite of products such as vSphere, vCenter, and NSX.

Proxmox VE:

Proxmox VE is an open-source virtualization platform built on the KVM hypervisor and provides a cost-effective solution for small and medium-sized businesses. The platform has a web-based management interface and supports containerization technology.

Key differences:

License(s):

  • VMware: Requires licensing for various components, which makes it a more expensive option, especially for large-scale deployments.
  • Proxmox VE: It is open source and eliminates licensing fees. However, business support is available for an additional fee.

Features:

  • VMware: Offers advanced features, including high availability, disaster recovery, storage management, and network virtualization. The platform excels in large-scale and complex environments.
  • Proxmox VE: It offers basic virtualization features such as high availability, storage management, and network configuration, and focuses on simplicity and ease of use.

Performance:

  • VMware: Widely recognized for its use of hardware acceleration and advanced optimization techniques, it is widely recognized for superior performance, especially in high-demand workloads.
  • Proxmox VE: Offers good performance, especially for Linux-based virtual machines. While it may not reach VMware's peak performance in all scenarios, it is usually suitable for most workloads.

Target Audience:

  • VMware: Primarily designed for large enterprises with complex IT infrastructure and demanding workloads that require advanced features and support.
  • Proxmox VE: It appeals to small and medium-sized businesses, budget-sensitive organizations, and individuals looking for an open-source virtualization solution.

When to choose which?

  • Choose VMware if:
    • You need enterprise-level features and support.
    • You have a large budget for IT.
    • You need to manage complex workloads and demanding applications.
    • Maximum performance and scalability are a priority for you.
  • Choose Proxmox VE if:
    • You have a limited budget.
    • You care about greater flexibility and control over your infrastructure.
    • Your workloads are mainly Linux-based.
    • You prefer to have an open source solution with a strong community.

Why migrate from VMware to Proxmox?

VMware, which has long been the industry standard, can create limitations for small and medium-sized businesses due to its proprietary features and associated costs. With Broadcom's recent decision, there are even more reasons to consider migrating to Proxmox.

Proxmox is an open-source, feature-rich alternative that offers flexibility and capabilities that offer significant benefits, including the ability to adapt and scale based on business needs. Its affordable pricing model makes it an attractive choice for businesses looking to optimize costs without sacrificing quality of service.

Differences:

  • Product Type: VMware is a commercial product platform that comes with extensive technical support, while Proxmox is an open-source software that is free to use but you can pay for business support.
  • Virtualization technology support: Proxmox supports OpenVZ, LXC, and KVM, while VMware supports its own proprietary KVM and technology.

Customers and Uses:

  • Proxmox is suitable for small and medium-sized organizations, educational institutions, and data centers looking for cost-effective and flexible solutions.
  • VMware is mostly designed for large enterprises and cloud service providers that need advanced features and robust support.

Special Features:

  • Proxmox offers built-in support for container execution, compatibility with a variety of hardware, and default security with firewall capabilities.
  • VMware supports infrastructure planning, support for critical operating systems, reduced deployment time, and increased DevOps speed.

Data Protection:

Storware Backup and Recovery offers a comprehensive solution for data protection in VMware and Proxmox virtualization environments. The software provides support for agentless backups, which means that there is no need to install agent software on separate virtual machines to protect data. This approach simplifies the deployment and management process and reduces the overall administrative burden.

Data Protection for Proxmox and VMware

Storware Backup and Recovery supports a variety of backup destinations, including local, remote, and cloud storage, providing flexibility and scalability. The software also has advanced features such as incremental backups, deduplication of data, and compression to optimize storage usage and reduce bandwidth consumption. Additionally, Storware Backup and Recovery is equipped with robust security measures, including encryption and immutability, to protect data from unauthorized access and ransomware attacks.

Key Features of Proxmox and VMware

Proxmox provides access control capabilities to protect applications from data intrusion. However, if the configuration is not done correctly, Proxmox's open-source software may be vulnerable to malicious activities and may not be suitable for large enterprise environments. In contrast, VMware is mainly used in enterprise environments because of its scalability and high reliability.

Conclusion

Ultimately, the choice between VMware and Proxmox depends on your organization's specific needs, budget, and technical requirements. VMware is the ideal choice for large enterprises and complex IT infrastructures due to its comprehensive suite of features, enterprise-level support, and seamless integration with other VMware solutions. However, the associated costs may be a barrier for small organizations.

On the other hand, Proxmox is an open-source, flexible, and affordable solution that appeals to startups, small and medium-sized businesses, and educational institutions. Adaptability, ease of use, and strong support from the community are a compelling alternative for those who want to manage virtualization without investing a lot of money. Both VMware and Proxmox platforms stand out in their respective domains, and understanding their strengths and weaknesses will allow you to make an informed decision that aligns with your organization's operational goals and needs. Whether you're looking for advanced features and support or looking for a cost-effective and user-friendly solution, both platforms offer unique benefits that can help your organization thrive in today's dynamic digital world.