diff --git a/src/lib/cloud-manager-hoc.jsx b/src/lib/cloud-manager-hoc.jsx
index 08104abf13519d9b0a86ac83850cb530747be09f..7e33cbf9fed98f7bdd84f0e89ceff301741fb65a 100644
--- a/src/lib/cloud-manager-hoc.jsx
+++ b/src/lib/cloud-manager-hoc.jsx
@@ -74,6 +74,7 @@ const cloudManagerHOC = function (WrappedComponent) {
             if (this.cloudProvider) {
                 this.cloudProvider.requestCloseConnection();
                 this.cloudProvider = null;
+                this.props.vm.setCloudProvider(null);
             }
         }
         render () {
diff --git a/test/unit/util/cloud-manager-hoc.test.jsx b/test/unit/util/cloud-manager-hoc.test.jsx
index 8f2716a3cc7687e3c3b6e01cdb017c738f1e44aa..d112c0392696f5301885df65d6c38db58f5cc0ba 100644
--- a/test/unit/util/cloud-manager-hoc.test.jsx
+++ b/test/unit/util/cloud-manager-hoc.test.jsx
@@ -50,6 +50,8 @@ describe('CloudManagerHOC', () => {
         );
         expect(vm.setCloudProvider.mock.calls.length).toBe(1);
         expect(CloudProvider).toHaveBeenCalledTimes(1);
+        const cloudProviderInstance = CloudProvider.mock.instances[0];
+        expect(vm.setCloudProvider).toHaveBeenCalledWith(cloudProviderInstance);
     });
 
     test('when cloudHost is missing, the cloud provider is not set on the vm', () => {
@@ -115,6 +117,8 @@ describe('CloudManagerHOC', () => {
         });
         expect(vm.setCloudProvider.mock.calls.length).toBe(1);
         expect(CloudProvider).toHaveBeenCalledTimes(1);
+        const cloudProviderInstance = CloudProvider.mock.instances[0];
+        expect(vm.setCloudProvider).toHaveBeenCalledWith(cloudProviderInstance);
     });
 
     test('projectId change should not trigger cloudProvider connection unless isShowingWithId becomes true', () => {
@@ -139,5 +143,32 @@ describe('CloudManagerHOC', () => {
         });
         expect(vm.setCloudProvider.mock.calls.length).toBe(1);
         expect(CloudProvider).toHaveBeenCalledTimes(1);
+        const cloudProviderInstance = CloudProvider.mock.instances[0];
+        expect(vm.setCloudProvider).toHaveBeenCalledWith(cloudProviderInstance);
+    });
+
+    test('when it unmounts, the cloud provider is set on the vm', () => {
+        const Component = () => (<div />);
+        const WrappedComponent = cloudManagerHOC(Component);
+        const mounted = mount(
+            <WrappedComponent
+                cloudHost="nonEmpty"
+                store={store}
+                username="user"
+                vm={vm}
+            />
+        );
+
+        expect(CloudProvider).toHaveBeenCalledTimes(1);
+        const cloudProviderInstance = CloudProvider.mock.instances[0];
+        const requestCloseConnection = cloudProviderInstance.requestCloseConnection;
+
+        mounted.unmount();
+
+        // vm.setCloudProvider is called twice,
+        // once during mount and once during unmount
+        expect(vm.setCloudProvider.mock.calls.length).toBe(2);
+        expect(vm.setCloudProvider).toHaveBeenCalledWith(null);
+        expect(requestCloseConnection).toHaveBeenCalledTimes(1);
     });
 });