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.
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.
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.
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.
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:
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.
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.
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.