---
title: 'vCenter 7.0 U2: "Swap File Location" cannot be changed to different datastore'
url: 'https://patrik.kernstock.net/blog/vcenter-7-0-u2-swap-file-location-cannot-be-changed-to-different-datastore'
markdown: 'https://patrik.kernstock.net/blog/vcenter-7-0-u2-swap-file-location-cannot-be-changed-to-different-datastore.md'
date: '2021-06-06'
description: 'As part of a customer request we were in need to change the swap location to a different datastore, as the current datastore was about to be removed in the near future. This post is meant as a quick note in case someone also despairs changing the datastore for the swap location in VMware vCenter 7.…'
taxonomy:
  category:
    - VMware
    - vSphere
  tag:
    - ESX
    - vCenter
---

# [vCenter 7.0 U2: "Swap File Location" cannot be changed to different datastore](https://patrik.kernstock.net/blog/vcenter-7-0-u2-swap-file-location-cannot-be-changed-to-different-datastore)

   June 6, 2021  (updated July 5, 2021)   1 min 

   [VMware](https://patrik.kernstock.net/category:VMware) [vSphere](https://patrik.kernstock.net/category:vSphere)    [ESX](https://patrik.kernstock.net/tag:ESX) [vCenter](https://patrik.kernstock.net/tag:vCenter)  

 Note

This article is more than 5 year(s) old – information may be outdated.

 ![vCenter 7.0 U2: "Swap File Location" cannot be changed to different datastore](https://patrik.kernstock.net/images/2/0/2/1/-/2021-06-0615-57-51-lzi7gltv-689b6b86.png?g-b3a1b014 "vCenter 7.0 U2: "Swap File Location" cannot be changed to different datastore") 

As part of a customer request we were in need to change the swap location to a different datastore, as the current datastore was about to be removed in the near future. This post is meant as a quick note in case someone also despairs changing the datastore for the swap location in VMware vCenter 7.0 Update 2 – just like I did.

# The issue

In vCenter 7.0 U2 there is a small HTML5 UI-bug which prevents the user from selecting a datastore, as the whole mask is simply disabled.

The issue looks like:

[![Datastore selection not possible](https://patrik.kernstock.net/user/pages/01.blog/2021-06-06-vcenter-7-0-u2-swap-file-location-cannot-be-changed-to-different-datastore/2021-06-06_16-29-10-RbqRecDk.png?g-b3a1b014)](https://patrik.kernstock.net/user/pages/01.blog/2021-06-06-vcenter-7-0-u2-swap-file-location-cannot-be-changed-to-different-datastore/2021-06-06_16-29-10-RbqRecDk.png?g-b3a1b014)

This requires that on the cluster-level you have set `Configure - General - Swap file location` to `Datastore specified by host`, as seen here:

[![Cluster-level setting for swap file location](https://patrik.kernstock.net/images/2/0/2/1/-/2021-06-0615-58-17-mmgz0krc-5d239d4e.png?g-b3a1b014)](https://patrik.kernstock.net/user/pages/01.blog/2021-06-06-vcenter-7-0-u2-swap-file-location-cannot-be-changed-to-different-datastore/2021-06-06_15-58-17-Mmgz0Krc.png?g-b3a1b014)

# Solution/Workaround

This is already addressed and will be fixed in vCenter 7.0 U3. As a workaround the change can be applied via PowerShell/PowerCLI.

To apply it on all hosts in a specific cluster:

```powershell
Connect-VIServer vcenter.domain.tld
Get-Cluster -Name "Cluster2" | Get-VMHost | Set-VMHost -VMSwapfileDatastore "NewDatastore"
```

To apply it on a specific host:

```powershell
Connect-VIServer vcenter.domain.tld
Get-VMHost -Name "esxi01.domain.tld" | Set-VMHost -VMSwapfileDatastore "NewDatastore"
```

PowerShell works as this is just an issue in the HTML5 UI client and the API requests and the core logic still works.

To install PowerCLI [see instructions here](https://blogs.vmware.com/PowerCLI/2018/01/powercli-offline-installation-walkthrough.html).

##     Comments    

 Sort by: 

Loading comments...

---

## Navigation

- Parent: [Blog](https://patrik.kernstock.net/index.md)
- Previous: [Avi/NSX ALB: Deleting httppolicyset via CLI](https://patrik.kernstock.net/blog/nsx-alb-avi-deleting-httppolicyset-via-cli.md)
- Next: [vCenter 7.0 U2: vSphere Native Key Provider! (integrated KMS)](https://patrik.kernstock.net/blog/vcenter-7-0-u2-vsphere-native-key-provider-integrated-kms.md)
