Re: [zfs-discuss] Ensure Newly created pool is imported automatically in new BE

2011-06-01 Thread Matt Keenan

Dan,

Tried export data after beadm umount, but on reboot zpool data is simply 
not imported at all...


So exporting data before reboot dosen;t appear to help..

thanks

Matt

On 06/01/11 01:35, Daniel Carosone wrote:

On Tue, May 31, 2011 at 05:32:47PM +0100, Matt Keenan wrote:

Jim,

Thanks for the response, I've nearly got it working, coming up against a
hostid issue.

Here's the steps I'm going through :

- At end of auto-install, on the client just installed before I manually
reboot I do the following :
   $ beadm mount solaris /a
   $ zpool export data
   $ zpool import -R /a -N -o cachefile=/a/etc/zfs/zpool.cache data
   $ beadm umount solaris
   $ reboot

- Before rebooting I check /a/etc/zfs/zpool.cache and it does contain
references to "data".

- On reboot, the automatic import of data is attempted however following
message is displayed :

  WARNING: pool 'data' could not be loaded as it was last accessed by
another system (host: ai-client hostid: 0x87a4a4). See
http://www.sun.com/msg/ZFS-8000-EY.

- Host id on booted client is :
   $ hostid
   000c32eb

As I don't control the import command on boot i cannot simply add a "-f"
to force the import, any ideas on what else I can do here ?

Can you simply export the pool again before rebooting, but after the
cachefile in /a has been unmounted?

--
Dan.


___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Ensure Newly created pool is imported automatically in new BE

2011-05-31 Thread Daniel Carosone
On Tue, May 31, 2011 at 05:32:47PM +0100, Matt Keenan wrote:
> Jim,
>
> Thanks for the response, I've nearly got it working, coming up against a  
> hostid issue.
>
> Here's the steps I'm going through :
>
> - At end of auto-install, on the client just installed before I manually  
> reboot I do the following :
>   $ beadm mount solaris /a
>   $ zpool export data
>   $ zpool import -R /a -N -o cachefile=/a/etc/zfs/zpool.cache data
>   $ beadm umount solaris
>   $ reboot
>
> - Before rebooting I check /a/etc/zfs/zpool.cache and it does contain  
> references to "data".
>
> - On reboot, the automatic import of data is attempted however following  
> message is displayed :
>
>  WARNING: pool 'data' could not be loaded as it was last accessed by  
> another system (host: ai-client hostid: 0x87a4a4). See  
> http://www.sun.com/msg/ZFS-8000-EY.
>
> - Host id on booted client is :
>   $ hostid
>   000c32eb
>
> As I don't control the import command on boot i cannot simply add a "-f"  
> to force the import, any ideas on what else I can do here ?

Can you simply export the pool again before rebooting, but after the
cachefile in /a has been unmounted? 
 
--
Dan.

pgp7IC9jTUesC.pgp
Description: PGP signature
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Ensure Newly created pool is imported automatically in new BE

2011-05-31 Thread Matt Keenan
I've written a possible solution using svc-system-config SMF where on 
first boot it will import -f a specified list of pools, and it does 
work, I was hoping to find a cleaner solution via zpool.cache... but if 
there's no way to achieve it I guess I'll have to stick with the other 
solution.


I even tried simply copying /etc/zfs/zpool.cache to 
/a/etc/zfs/zpool.cache and not exporting/importing the data pool at all, 
however this gave the same hostid problem.


thanks for your help.

cheers

Matt

Jim Klimov wrote:

Actually if you need beadm to "know" about the data pool,
it might be beneficial to mix both approaches - yours with
bemount, and init-script to enforce the pool import on that
first boot...
 
HTH,

//Jim Klimov
 


___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Ensure Newly created pool is imported automatically in new BE

2011-05-31 Thread Jim Klimov
Actually if you need beadm to "know" about the data pool,
it might be beneficial to mix both approaches - yours with 
bemount, and init-script to enforce the pool import on that 
first boot...
 
HTH,
//Jim Klimov
 
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Ensure Newly created pool is imported automatically in new BE

2011-05-31 Thread Jim Klimov
I should have seen that coming, but didn't ;)
 
I think in ths case I would go with a different approach: don't
import the data pool in the AI instance and save it to zpool.cache
Instead, make sure it is cleanly exported from AI instance, and
in the installed system create a self-destructing init script or SMF
service. For an init script in might go like this:
 
#!/bin/sh
# /etc/rc2.d/S00importdatapool
[ "$1" = start ] && zpool import -f datapool && rm -f "$0"
 
Or you can try setting the hostid in a persisnt manner (perhaps
via eeprom emulation in /boot/solaris/bootenv.rc ?)

- Original Message -
From: Matt Keenan 
Date: Tuesday, May 31, 2011 21:02
Subject: Re: [zfs-discuss] Ensure Newly created pool is imported automatically 
in new BE
To: j...@cos.ru
Cc: zfs-discuss@opensolaris.org

> Jim,
> 
> Thanks for the response, I've nearly got it working, coming up 
> against a 
> hostid issue.
> 
> Here's the steps I'm going through :
> 
> - At end of auto-install, on the client just installed before I 
> manually 
> reboot I do the following :
>$ beadm mount solaris /a
>$ zpool export data
>$ zpool import -R /a -N -o 
> cachefile=/a/etc/zfs/zpool.cache data
>$ beadm umount solaris
>$ reboot
> 
> - Before rebooting I check /a/etc/zfs/zpool.cache and it does 
> contain 
> references to "data".
> 
> - On reboot, the automatic import of data is attempted however 
> following 
> message is displayed :
> 
>   WARNING: pool 'data' could not be loaded as it was last 
> accessed by 
> another system (host: ai-client hostid: 0x87a4a4). See 
> http://www.sun.com/msg/ZFS-8000-EY.
> 
> - Host id on booted client is :
>$ hostid
>000c32eb
> 
> As I don't control the import command on boot i cannot simply 
> add a "-f" 
> to force the import, any ideas on what else I can do here ?
> 
> cheers
> 
> Matt
> 
> On 05/27/11 13:43, Jim Klimov wrote:
> > Did you try it as a single command, somewhat like:
> >
> > zpool create -R /a -o cachefile=/a/etc/zfs/zpool.cache mypool c3d0
> > Using altroots and cachefile(=none) explicitly is a nearly-
> documented> way to avoid caching pools which you would not want 
> to see after
> > reboot, i.e. removable media.
> > I think that after the AI is done and before reboot you might 
> want to
> > reset the altroot property to point to root (or be undefined) 
> so that
> > the data pool is mounted into your new rpools hierarchy and not
> > under "/a/mypool" again ;)
> > And if your AI setup does not use the data pool, you might be better
> > off not using altroot at all, maybe...
> >
> > - Original Message -
> > From: Matt Keenan 
> > Date: Friday, May 27, 2011 13:25
> > Subject: [zfs-discuss] Ensure Newly created pool is imported 
> > automatically in new BE
> > To: zfs-discuss@opensolaris.org
> >
> > > Hi,
> > >
> > > Trying to ensure a newly created data pool gets import on boot
> > > into a
> > > new BE.
> > >
> > > Scenario :
> > >Just completed a AI install, and on the client
> > > before I reboot I want
> > > to create a data pool, and have this pool automatically imported
> > > on boot
> > > into the newly installed AI Boot Env.
> > >
> > >Trying to use the -R altroot option to 
> zpool create
> > > to achieve this or
> > > the zpool set -o cachefile property, but having no luck, and
> > > would like
> > > some advice on what the best means of achieving this would be.
> > >
> > > When the install completes, we have a default root pool 
> "rpool", which
> > > contains a single default boot environment, rpool/ROOT/solaris
> > >
> > > This is mounted on /a so I tried :
> > > zpool create -R /a mypool c3d0
> > >
> > > Also tried :
> > > zpool create mypool c3d0
> > > zpool set -o cachefile=/a mypool
> > >
> > > I can clearly see /a/etc/zfs/zpool.cache contains information
> > > for rpool,
> > > but it does not get any information about mypool. I would expect
> > > this
> > > file to contain some reference to mypool. So I tried :
> > > zpool set -o 
> cachefile=/a/etc/zfs/zpool.cache> >
> > > Which fails.
> > >
> > > Any advice would be great.
> > >
> > > cheers
> > >
> > > Matt
> > > ___
> > > zfs-discuss

Re: [zfs-discuss] Ensure Newly created pool is imported automatically in new BE

2011-05-31 Thread Matt Keenan

Jim,

Thanks for the response, I've nearly got it working, coming up against a 
hostid issue.


Here's the steps I'm going through :

- At end of auto-install, on the client just installed before I manually 
reboot I do the following :

  $ beadm mount solaris /a
  $ zpool export data
  $ zpool import -R /a -N -o cachefile=/a/etc/zfs/zpool.cache data
  $ beadm umount solaris
  $ reboot

- Before rebooting I check /a/etc/zfs/zpool.cache and it does contain 
references to "data".


- On reboot, the automatic import of data is attempted however following 
message is displayed :


 WARNING: pool 'data' could not be loaded as it was last accessed by 
another system (host: ai-client hostid: 0x87a4a4). See 
http://www.sun.com/msg/ZFS-8000-EY.


- Host id on booted client is :
  $ hostid
  000c32eb

As I don't control the import command on boot i cannot simply add a "-f" 
to force the import, any ideas on what else I can do here ?


cheers

Matt

On 05/27/11 13:43, Jim Klimov wrote:

Did you try it as a single command, somewhat like:

zpool create -R /a -o cachefile=/a/etc/zfs/zpool.cache mypool c3d0
Using altroots and cachefile(=none) explicitly is a nearly-documented
way to avoid caching pools which you would not want to see after
reboot, i.e. removable media.
I think that after the AI is done and before reboot you might want to
reset the altroot property to point to root (or be undefined) so that
the data pool is mounted into your new rpools hierarchy and not
under "/a/mypool" again ;)
And if your AI setup does not use the data pool, you might be better
off not using altroot at all, maybe...

- Original Message -
From: Matt Keenan 
Date: Friday, May 27, 2011 13:25
Subject: [zfs-discuss] Ensure Newly created pool is imported 
automatically in new BE

To: zfs-discuss@opensolaris.org

> Hi,
>
> Trying to ensure a newly created data pool gets import on boot
> into a
> new BE.
>
> Scenario :
>Just completed a AI install, and on the client
> before I reboot I want
> to create a data pool, and have this pool automatically imported
> on boot
> into the newly installed AI Boot Env.
>
>Trying to use the -R altroot option to zpool create
> to achieve this or
> the zpool set -o cachefile property, but having no luck, and
> would like
> some advice on what the best means of achieving this would be.
>
> When the install completes, we have a default root pool "rpool", which
> contains a single default boot environment, rpool/ROOT/solaris
>
> This is mounted on /a so I tried :
> zpool create -R /a mypool c3d0
>
> Also tried :
> zpool create mypool c3d0
> zpool set -o cachefile=/a mypool
>
> I can clearly see /a/etc/zfs/zpool.cache contains information
> for rpool,
> but it does not get any information about mypool. I would expect
> this
> file to contain some reference to mypool. So I tried :
> zpool set -o cachefile=/a/etc/zfs/zpool.cache
>
> Which fails.
>
> Any advice would be great.
>
> cheers
>
> Matt
> ___
> zfs-discuss mailing list
> zfs-discuss@opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
--

++
||
| Климов Евгений, Jim Klimov |
| технический директор   CTO |
| ЗАО "ЦОС и ВТ"  JSC COS&HT |
||
| +7-903-7705859 (cellular)  mailto:jimkli...@cos.ru |
|CC:ad...@cos.ru,jimkli...@gmail.com |
++
| ()  ascii ribbon campaign - against html mail  |
| /\- against microsoft attachments  |
++


___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Ensure Newly created pool is imported automatically in new BE

2011-05-27 Thread Jim Klimov
Did you try it as a single command, somewhat like:

zpool create -R /a -o cachefile=/a/etc/zfs/zpool.cache mypool c3d0

Using altroots and cachefile(=none) explicitly is a nearly-documented
way to avoid caching pools which you would not want to see after
reboot, i.e. removable media.
 
I think that after the AI is done and before reboot you might want to 
reset the altroot property to point to root (or be undefined) so that 
the data pool is mounted into your new rpools hierarchy and not 
under "/a/mypool" again ;)
 
And if your AI setup does not use the data pool, you might be better 
off not using altroot at all, maybe...

- Original Message -
From: Matt Keenan 
Date: Friday, May 27, 2011 13:25
Subject: [zfs-discuss] Ensure Newly created pool is imported automatically in 
new BE
To: zfs-discuss@opensolaris.org

> Hi,
> 
> Trying to ensure a newly created data pool gets import on boot 
> into a 
> new BE.
> 
> Scenario :
>Just completed a AI install, and on the client 
> before I reboot I want 
> to create a data pool, and have this pool automatically imported 
> on boot 
> into the newly installed AI Boot Env.
> 
>Trying to use the -R altroot option to zpool create 
> to achieve this or
> the zpool set -o cachefile property, but having no luck, and 
> would like 
> some advice on what the best means of achieving this would be.
> 
> When the install completes, we have a default root pool "rpool", which
> contains a single default boot environment, rpool/ROOT/solaris
> 
> This is mounted on /a so I tried :
> zpool create -R /a mypool c3d0
> 
> Also tried :
> zpool create mypool c3d0
> zpool set -o cachefile=/a mypool
> 
> I can clearly see /a/etc/zfs/zpool.cache contains information 
> for rpool, 
> but it does not get any information about mypool. I would expect 
> this 
> file to contain some reference to mypool. So I tried :
> zpool set -o cachefile=/a/etc/zfs/zpool.cache
> 
> Which fails.
> 
> Any advice would be great.
> 
> cheers
> 
> Matt
> ___
> zfs-discuss mailing list
> zfs-discuss@opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
 
 
-- 

++ 
|| 
| Климов Евгений, Jim Klimov | 
| технический директор   CTO | 
| ЗАО "ЦОС и ВТ"  JSC COS&HT | 
|| 
| +7-903-7705859 (cellular)  mailto:jimkli...@cos.ru | 
|CC:ad...@cos.ru,jimkli...@gmail.com | 
++ 
| ()  ascii ribbon campaign - against html mail  | 
| /\- against microsoft attachments  | 
++
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


[zfs-discuss] Ensure Newly created pool is imported automatically in new BE

2011-05-27 Thread Matt Keenan

Hi,

Trying to ensure a newly created data pool gets import on boot into a 
new BE.


Scenario :
  Just completed a AI install, and on the client before I reboot I want 
to create a data pool, and have this pool automatically imported on boot 
into the newly installed AI Boot Env.


  Trying to use the -R altroot option to zpool create to achieve this or
the zpool set -o cachefile property, but having no luck, and would like 
some advice on what the best means of achieving this would be.


When the install completes, we have a default root pool "rpool", which
contains a single default boot environment, rpool/ROOT/solaris

This is mounted on /a so I tried :
   zpool create -R /a mypool c3d0

Also tried :
   zpool create mypool c3d0
   zpool set -o cachefile=/a mypool

I can clearly see /a/etc/zfs/zpool.cache contains information for rpool, 
but it does not get any information about mypool. I would expect this 
file to contain some reference to mypool. So I tried :

   zpool set -o cachefile=/a/etc/zfs/zpool.cache

Which fails.

Any advice would be great.

cheers

Matt
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss