Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto mounting functionality for shared folders #480

Closed
gbraad opened this issue Feb 24, 2017 · 22 comments
Closed

Auto mounting functionality for shared folders #480

gbraad opened this issue Feb 24, 2017 · 22 comments

Comments

@gbraad
Copy link
Member

gbraad commented Feb 24, 2017

  1. Allow configuration to auto mount shares
  2. Prevent remounting mounted shares
  3. Check if host is reachable
  4. Command to add configuration by name
  5. Command to remove configuration by name
  6. Command to mount share by name
  7. Command to unmount share by name
  8. Auto mount option for Users share
@gbraad
Copy link
Member Author

gbraad commented Feb 24, 2017

Development can be tracked in the branch: https://github.com/gbraad/minishift/tree/mount-shares

Configuration needed:

{
    "iso-url": "file://C:/Users/gbraad/.minishift/cache/iso/minishift-cifs.iso",
    "vm-driver": "hyperv",
    "shares": [
        {"name": "Users", "uncpath": "//RHGBWIN10/Users", "username": "gbraad@redhat.com", "password": "********", "domain": "RHGBWIN10"},
        {"name": "Disks", "uncpath": "//10.0.21.33/disks", "username": "root", "password": "********", "domain": ""}
    ]
}
PS C:\work\src\github.com\minishift\minishift> .\out\windows-amd64\minishift.exe start
Starting local OpenShift cluster using 'hyperv' hypervisor...
-- Mounting 'Users': '//RHGBWIN10/Users' ... OK
-- Mounting 'Disks': '//10.0.21.33/disks' ... OK
Provisioning OpenShift via 'C:\Users\gbraad\.minishift\cache\oc\v1.4.1\oc.exe [cluster up --use-existing-config --
onfig-dir /var/lib/minishift/openshift.local.config --host-data-dir /var/lib/minishift/hostdata --host-volumes-dir
lib/minishift/openshift.local.volumes]'
-- Checking OpenShift client ... OK

@gbraad
Copy link
Member Author

gbraad commented Feb 24, 2017

@hferentschik @LalatenduMohanty I would not really like to introduce a new verb as command, but I think this is needed? ...

$ minishift mount [params]
$ minishift unmount [name]

This feels weird...

So, what about?

$ minishift share mount [name]
$ minishift share unmount [name]

Or place them inside the config command?

And how to structure them for edit and save? WDYT? I have an idea, but I appreciate feedback...

@hferentschik
Copy link
Member

I would not really like to introduce a new verb as command

Sure. How do you want to use that? Once Minishift is up you do mount/umount? I guess I am trying to figure out how this is tied into the current behavior of say VirtualBox and that it transparently mounts your home directory (same for xhyve with the appropriate flags).

Will host folder mounts on Windows with Samba shares work differently (in terms off when and how they are established) than with VirtualBox and guest additions? Or moving forward with sshfs?

@gbraad maybe you can outline how current host folder mount behavior is going to be unified with what you are doing now and this new command.

Generally, I like the idea. I like the idea of having the ability to potentially umount a directory and mount a different one. What about something like

$ minishift hostfolder [view|mount|umount]

So I am proposing hostfolder as command name which seems more generic. 'share' might be pointing into Windows share and afaiu this is more generic. view let's you view the current host folders and mount and umount do the mounting and unmounting.

mount would also have a flag type which lets you select between say windows share, sshfs, nfs (xhyve).

Or place them inside the config command?

It's a possibility, but I don't think it works with the existing set. You would still need config mount, right? Seems not so intuitive to me.

@hferentschik
Copy link
Member

Another question in my mind. How is Windows shares host folder mounting working together with another potentially exiting host folder mount. Taking VirtualBox again. If I start the default B2D image on Windows, what's going to happen?

@gbraad
Copy link
Member Author

gbraad commented Feb 27, 2017

Implemented in gbraad-redhat@bbec167:

  • minishift hostfolder
    • mount name
    • umount name
PS > C:\work\bin\minishift.exe ssh "mount | grep Disks"
PS > C:\work\bin\minishift.exe hostfolder mount Disks
-- Mounting 'Disks': '//10.0.21.33/disks' ... OK
PS > C:\work\bin\minishift.exe ssh "mount | grep Disks"
//10.0.21.33/disks on /mnt/sda1/Disks type cifs (...)
PS > C:\work\bin\minishift.exe hostfolder umount Disks
-- Unmounting 'Disks': '//10.0.21.33/disks' ... OK
PS > C:\work\bin\minishift.exe ssh "mount | grep Disks"
PS >

@gbraad
Copy link
Member Author

gbraad commented Mar 5, 2017

Will finish the mount check and IP reachability, and then defer configuration to instance specific helper functionality (see #487)

@gbraad
Copy link
Member Author

gbraad commented Mar 7, 2017

$ minishift hostfolder mount unreachable
Mounting 'unreachable': '//unreachable/disks' ... Unreachable
$ minishift hostfolder umount unreachable
Unmounting 'unreachable': '//unreachable/disks' ... Not mounted
$ minishift hostfolder mount Disks
Mounting 'Disks': '//10.0.21.33/disks' ... Already mounted
$ minishift hostfolder umount Disks
Unmounting 'Disks': '//10.0.21.33/disks' ... OK
$ minishift hostfolder mount Disks
Mounting 'Disks': '//10.0.21.33/disks' ... OK
$ minishift hostfolder mount Disks
Mounting 'Disks': '//10.0.21.33/disks' ... Already mounted

@gbraad
Copy link
Member Author

gbraad commented Mar 7, 2017

Currently remaining is:

I have an idea how to tackle the automount of Users:

  • check if not Users already configed
  • get hostips (check reachable)
  • get hostip in range of instance ip
  • construct uncpath
  • ask for credentials
  • store as preserved hostfolder name: Users

@hferentschik
Copy link
Member

if driver is hyper-v

this works only for Hyper-V?

@gbraad
Copy link
Member Author

gbraad commented Mar 8, 2017

only for Hyper-V

@hferentschik no, I'd rather not... just not sure about conflicts. We can not automount Users right away when we are unsure of the hosting platform, as this will only work for Windows.

Will test with Virtualbox today... Just pushed a WIP for feedback which used the instance configuration. Will move to VirtualBox for some testing. None of the current code enforces the libmachine Driver.

gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 8, 2017
@hferentschik
Copy link
Member

Will move to VirtualBox for some testing. None of the current code enforces the libmachine Driver.

right, that's what I was assuming and hoping for ;-)

gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 8, 2017
@gbraad
Copy link
Member Author

gbraad commented Mar 8, 2017

test command for hostip now only returns a host IP address in the same network as the minishift instance. Eg.

PS C:\work\src\github.com\minishift\minishift> minishift.exe hostip
   Checking if '10.0.21.122' is reachable ... OK

this will be used for the construction of the uncpath to the local shares for //hostip/Users, but likely also for @hferentschik's sshfs path ;-).

@coolbrg
Copy link
Contributor

coolbrg commented Mar 8, 2017

@gbraad 👍 Nice

I would love to have this output though 😉

..> minishift.exe hostip
10.0.21.122

@gbraad
Copy link
Member Author

gbraad commented Mar 8, 2017

@budhrg this command will disappear...

gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 9, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 9, 2017
@gbraad
Copy link
Member Author

gbraad commented Mar 9, 2017

Added config add/remove functionality

gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 9, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 21, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 21, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 21, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 21, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 22, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 22, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 22, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 22, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 22, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 22, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 23, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 23, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 23, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 24, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 24, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 24, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 24, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 24, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 24, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 24, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 24, 2017
gbraad added a commit to gbraad-redhat/minishift that referenced this issue Mar 28, 2017
hferentschik pushed a commit that referenced this issue Mar 31, 2017
@hferentschik
Copy link
Member

Merged via pull request #581. 👍

@Jhstvf4t
Copy link

sorry boss, I ran out of money in and out of the workshop, what would I eat if the money was only for repairing motorbikes etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants