How to share/mount ZFS in two non-global zones?


 
Thread Tools Search this Thread
Operating Systems Solaris How to share/mount ZFS in two non-global zones?
# 1  
Old 10-25-2010
How to share/mount ZFS in two non-global zones?

Hi All, first time here. Smilie

I need a some assistance with ZFS.

I have two ZFS pools:

Code:
zoneA/nfs_export
zoneB/nfs_export

Each dataset is mounted in a particular zone (zoneA and zoneB respectively).

I have created a new dataset "zoneA/nfs_tmp" which I want to mount or share between the two zones so that if a user in zoneA "touches" a file in "/nfs_tmp" the file is "visible" in zoneB.

Code:
zoneA/nfs_export
zoneA/nfs_tmp 
zoneB/nfs_export

So far I have tried changing the default mountpoint of "zoneA/nfs_tmp " to "/zoneA/root/nfs_tmp" and altough the FS gets mounted successfully I'm not able to figure out how to make it visible in the other zone.

Thanks. Smilie

-Gab
# 2  
Old 10-25-2010
you can't mount a filesystem twice on different servers (not without problems or not at all) and a zpool can only be owned by one host (at a time). mounting a filesystem across multiple hosts is a job for a "cluster" filesystem.
but in your case, a NFS share would be an easier option. share a fielsystem in the globel (or inside a local zone; does this work yet?) zone with NFS and mount the share inside the zones.
# 3  
Old 10-25-2010
Quote:
Originally Posted by DukeNuke2
you can't mount a filesystem twice on different servers
unless you use lofs mounts.
Quote:
but in your case, a NFS share would be an easier option. share a fielsystem in the global (or inside a local zone; does this work yet?) zone with NFS and mount the share inside the zones.
This wont work. A non global zone can't be a NFS server. A global zone can be a NFS server but having a non global zones as its NFS client is definitely unsupported. The simple workaround is to use lofs to share filesystems between zones.
# 4  
Old 10-26-2010
As already been said, there are two ways to get your goal:

1.) Attach the dataset to global zone and as LOFS to local zone:
Code:
add fs
set dir=<path_in_zone>
set spezial=<path_in_global>
set type=lofs
set options=nodevices

2.) Use NFS share, using normal /etc/dfs/dfstab in global and /etc/vfstab in zone.

However, using LOFS to share one dataset into two local zones can be risky as hell, if both zones work on same data (read-write), Therefore I would use second opinion only.
# 5  
Old 10-26-2010
Quote:
Originally Posted by blicki
However, using LOFS to share one dataset into two local zones can be risky as hell, if both zones work on same data (read-write)
This doesn't make sense. Having multiple processes accessing the same file in r/w mode might be risky regardless of whether the file system is local or not and regardless of the accessing processes running on the same kernel or not. You can lofs mount in read-only mode should you want to avoid that specific issue. On the other hand, it is extremely common to have NFS, cifs or lofs shares in r/w mode and this definitely serves a purpose. File locking is the usual way to avoid multiple processes concurrently accessing the same file.
Quote:
Therefore I would use second opinion only.
You really shouldn't. This is not supported (see NOTES in the mount_nfs manual page). It is well know to create kernel deadlocks, which are much "riskier as hell" than the previous solution you discarded.

Bug ID: 6811806 automounter should prevent zone-to-global-zone mounts
# 6  
Old 10-28-2010
Thanks you guys.

I opted for the NFS approach (r/w). I know it's barely supported by Sun but I will only be using the datased for a few days. Smilie

-Gab
# 7  
Old 10-28-2010
I'm always perplexed when people opt to implement a solution which is unsupported, slower and more complex than the supported one. Oh well ...
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Solaris Global/Zones patching

Issue is : We have Solaris Global with 12 Zones and some have 15 Zones. All the OS version are10. Is it possible to apply patch at Zone level instead of patching at Global level? Please let me know. (10 Replies)
Discussion started by: baladelaware73
10 Replies

2. Solaris

Solaris 10 - rexplorer and Non-Global zones

Hi all - not really a problem as such, but just hoping someone can shed some light. We point rexplorer to multiple Global zones and it works as expected. However, each Non-Global zone get around a hundred of root su'ing to root messages, i.e.: SU 07/14 03:02 + ??? root-root SU 07/14 03:02 +... (5 Replies)
Discussion started by: dlam
5 Replies

3. Shell Programming and Scripting

Script to mount nas-share using generated credentials (mount EC 13,32)

Heyas At home i have 1 nas with 3 shares, of which i used to mount 2 of them using a script with hardcoded password and username in it. EDIT: Turns out, its not the script, but 'how i access' the nas share.. (-o user=XY,password=... VS. -o credentials=...). Figured about credential files,... (0 Replies)
Discussion started by: sea
0 Replies

4. Solaris

cpu- requirements for non-global zones

Hello Admins, Does anyone has any idea on how to assign no. of cpu and memory to non-global zones on solaris 10..... We have few zones in our environment. We wanted to assign memory and no of cpu's ..(e.g. 4Gb / 2 CPU's) Thanks... (4 Replies)
Discussion started by: snchaudhari2
4 Replies

5. Solaris

How to see global hostname by logging in non global zones?

Hi guru Could any one help me by letting me know, how to see global hostname by logging in non global zones Regards (2 Replies)
Discussion started by: girish.batra
2 Replies

6. Solaris

How to access ENV variables of non global zones in global zone???

Hi Guys, My requirement is I have file called /opt/orahome/.profile in non global zone. PATH=/usr/bin:/usr/ucb:/etc:/usr/sbin:/usr/local/bin:/usr/openwin/bin:. export PATH PS1="\${ORACLE_SID}:`hostname`:\$PWD$ " export PS1 EDITOR=vi export EDITOR ENV=/opt/orahome/.kshrc export ENV... (1 Reply)
Discussion started by: vijaysachin
1 Replies

7. Solaris

Global zones - not allow log via SSH

Hi, I have Global zone and 2 users: root and app. I know password root and app. When a user app log - putty displays Access denied Using keyboard-interactive authentication. In file /etc/security/policy.conf I set CRYPT_DEFAULT=2a And in file /etc/ssh/sshd_config I set PermitRootLogin... (1 Reply)
Discussion started by: bieszczaders
1 Replies

8. IP Networking

Can't see home folder on one NFS mount but can in another mount on another share

Hello, I have a few Ubuntu 9.10 laptops I'm trying to learn NFS sharing with. I am just experimenting on this right now, so no harsh words about the security of what I'm playing with, please ;) Below are the configs /etc/exports on host /home/woodnt/Homeschool... (2 Replies)
Discussion started by: Narnie
2 Replies

9. Solaris

Global Zones

I'm logged into a non-global zone server. How would I find out what the global zone server name is from there? (1 Reply)
Discussion started by: soupbone38
1 Replies
Login or Register to Ask a Question