Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Volume creation succeeds on a datastore which is in maintenance mode #1651

Closed
ashahi1 opened this issue Jul 27, 2017 · 5 comments
Closed

Volume creation succeeds on a datastore which is in maintenance mode #1651

ashahi1 opened this issue Jul 27, 2017 · 5 comments

Comments

@ashahi1
Copy link
Contributor

ashahi1 commented Jul 27, 2017

Steps:

1. Created a datastore cluster of two datastores - sharedVmfs-1 and sharedVmfs-0
2. Put sharedVmfs-1 in 'Maintenance Mode'
3. Then was able to create volume to the datastore  - sharedVmfs-1
4. Successfully mounted the volume to a container and was also able to write data to it.

This should not be allowed. Volume creation should not succeed on datastore which is in maintenance mode as user may have put it in maintenance mode to perform some service on it or user may even decide to drop the datastore completely which is in maintenance mode.

Logs have been attached at the end.


Steps and their output are as follows:

  1. Create a volume
root@sc-rdops-vm02-dhcp-52-237:~# docker volume create -d vsphere:latest --name TestVolMM@sharedVmfs-1
TestVolMM@sharedVmfs-1
root@sc-rdops-vm02-dhcp-52-237:~#
root@sc-rdops-vm02-dhcp-52-237:~#
root@sc-rdops-vm02-dhcp-52-237:~# docker volume ls
DRIVER              VOLUME NAME
vsphere:latest      TestVolMM@sharedVmfs-1
vsphere:latest      TestVolSS@sharedVmfs-0
vsphere:latest      VolSS1@sharedVmfs-0
root@sc-rdops-vm02-dhcp-52-237:~#

  1. Docker volume inspect
root@sc-rdops-vm02-dhcp-52-237:~# docker volume inspect TestVolMM@sharedVmfs-1
[
    {
        "Driver": "vsphere:latest",
        "Labels": {},
        "Mountpoint": "/mnt/vmdk/TestVolMM@sharedVmfs-1",
        "Name": "TestVolMM@sharedVmfs-1",
        "Options": {},
        "Scope": "global",
        "Status": {
            "access": "read-write",
            "attach-as": "independent_persistent",
            "capacity": {
                "allocated": "13MB",
                "size": "100MB"
            },
            "clone-from": "None",
            "created": "Thu Jul 27 19:30:13 2017",
            "created by VM": "ubuntu-VM0.1",
            "datastore": "sharedVmfs-1",
            "diskformat": "thin",
            "fstype": "ext4",
            "status": "detached"
        }
    }
]

  1. Mount the volume to a container and write some data
root@sc-rdops-vm02-dhcp-52-237:~# docker run -it --volume-driver=vsphere:latest -v TestVolMM@sharedVmfs-1:/vol1 --name ubMM ubuntu
root@0a16291ffec1:/#
root@0a16291ffec1:/# echo "Hello" > vol1/hellos2
root@0a16291ffec1:/# cat vol1/hellos2
Hello
root@0a16291ffec1:/#

Logs:
docker-volume-vsphere.txt
vmdk_ops.txt

@ashahi1 ashahi1 added the P0 label Jul 27, 2017
@ashahi1 ashahi1 added this to the Sprint - Pumbaa milestone Jul 27, 2017
@ashahi1 ashahi1 changed the title Volume creation succeeds on a datastore which in maintenance mode Volume creation succeeds on a datastore which is in maintenance mode Jul 27, 2017
@lipingxue
Copy link
Contributor

@ashahi1 Can we create and attach VMDK to VM using ESXi UI when the datastore is in maintenance mode?

@ashahi1
Copy link
Contributor Author

ashahi1 commented Jul 31, 2017

@lipingxue I tried from VC but I am not able to create VM on a datastore which is in maintenance mode. That particular datastore is not listed among available datastore for vm creation. Datastore maintenance mode is a VC feature.
Also, there is no event generated in hostd logs when datastore is put in maintenance mode. So it looks like ESX side is unaware of datastore maintenance mode.

Dockvols folder on datatore which is in maintenance mode, does show created vmdk.

@lipingxue
Copy link
Contributor

@ashahi1 Since esx is not aware of datastore in maintenance mode, and still can create vmdk on the datastore, no fix can be done. We should document it as known issue.

@shuklanirdesh82
Copy link
Contributor

@ashahi1 as discussed offline please include this into the same PR where you are adding information for inter-op features.

@ashahi1
Copy link
Contributor Author

ashahi1 commented Aug 10, 2017

Fixed as part of PR #1689

@ashahi1 ashahi1 closed this as completed Aug 10, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

4 participants