[Solved] how can 2 opensol guests share 1 disk?

Discussions about using Solaris guests in VirtualBox.
Post Reply
thorstenhirsch
Posts: 9
Joined: 10. Oct 2009, 00:10
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: OpenSolaris

[Solved] how can 2 opensol guests share 1 disk?

Post by thorstenhirsch »

Hi,

I created a 20 GB disk in VB (static) and attached it to both of my opensol machines as primary / slave. Then I started machine A and created a zfs pool "hd1" with the whole new drive (/dev/rdsk/c7d1) and put ~5 GB of data on it. Finally, I powered down machine A.

Then I started machine B and wanted to access the data, so I also created a zfs pool with /dev/rdsk/c7d1. So basically the configuration is the very same on machine A and B. The only difference is, that machine A is using snv_123 while B is already on snv_123. The problem is, that only machine A can see the data on the new zfs pool. machine B says, that it's empty.

Machine A

Code: Select all

$ zpool list
NAME    SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
hd1    20.1G  5.67G  14.5G    28%  ONLINE  -
rpool  11.9G  10.0G  1.93G    83%  ONLINE  -
Machine B

Code: Select all

$ zpool list
NAME    SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
hd1    20.1G  78.5K  20.1G     0%  ONLINE  -
rpool  15.9G  8.00G  7.88G    50%  ONLINE  -
Why can't machine B see the data? And why are there 20 GB available, though ~5 GB are used? I am sure that both machines share the same vdi file, because when I try to start a machine while the other is running, VB says, that the drive is locked and refuses to start the 2nd machine.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: how can 2 opensol guests share 1 disk?

Post by Sasquatch »

Have you ever tried connecting one physical hard drive to two computers at the same time and access them natively at the same time? Answer that question and you have your answer.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
thorstenhirsch
Posts: 9
Joined: 10. Oct 2009, 00:10
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: OpenSolaris

Re: how can 2 opensol guests share 1 disk?

Post by thorstenhirsch »

Please read my question again. I did not try to use the disk simultaneously (well, I did, but just to proof that it's the same vdi file). I tried to use the disk in only 1 machine at the same time.
thorstenhirsch
Posts: 9
Joined: 10. Oct 2009, 00:10
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: OpenSolaris

Re: how can 2 opensol guests share 1 disk?

Post by thorstenhirsch »

A guy in #opensolaris just explained to me, that "zpool create" is like mkfs, so my data is gone ...normally. Looks like VB has a different behavior as I can still see my data in machine A. Also "zpool create" gives a warning if it detects an existing zpool on the disk and I would have needed "-f" to actually run the command. So it has not detected an existing zpool. That's really weird.

But the guy also gave me a hint: "zpool import". And yes, after "zpool destroy hd1" I could import the (still) existing hd1 pool from machine A like that:

Code: Select all

zpool import -f hd1
And my data is still there!
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: how can 2 opensol guests share 1 disk?

Post by Sasquatch »

This shows that it wasn't much of a VB question but more of a Solaris question. That is not quite in the scope of this forum, hence my misunderstanding (I've never seen Solaris too). Your problem could've happened on normal systems too where you would share one hard drive (e.g. external) with two systems.
I'll mark this one as solved.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
thorstenhirsch
Posts: 9
Joined: 10. Oct 2009, 00:10
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: OpenSolaris

Re: [Solved] how can 2 opensol guests share 1 disk?

Post by thorstenhirsch »

Yes, that's true.
Just one more info: some of the data is lost. I guess "zpool create" on machine B has caused it. So the only question left is: why didn't zpool warn me, that there's an existing pool on the disk? I know mkfs wouldn't warn me, either, but zpool should have done so. Anyway, that might be a bug in OpenSolaris, too, because I'm using the snapshot builds.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: [Solved] how can 2 opensol guests share 1 disk?

Post by Sasquatch »

That's something you should ask on the OpenSolaris forum. We don't have the expertise to answer that question.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply