-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP zfs-vol: implement sr-create 1/4: SR.create
FIXME: pool passed through `zpool` should get a sanity check before being accepted, and get aligned with what we otherwise create SR can then be disposed of using "xe sr-forget" and "zpool destroy". Underlying zpool can be either separately created and given to SR.create, or a set of devices can be specified to create a new zpool on. Notes: - `SR.attach` will be necessary to complete `sr-create`: while from a calling user PoV things appear to have gone fine, SMlog reveals a call to `SR.attach`, which naturally failed as not yet implemented. Any attempt to `xe pbd-plug` naturally also fails. See xapi-project/xen-api#5532. - there is no plugin feature to shield from SR.* calls Originally-by: Matias Ezequiel Vara Larsen <[email protected]> Signed-off-by: Yann Dirson <[email protected]>
- Loading branch information
Showing
2 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import os | ||
|
||
from xapi.storage.common import call | ||
|
||
MOUNT_ROOT = '/var/run/sr-mount' | ||
|
||
def pool_mountpoint(dbg, pool_name): | ||
cmd = "zfs get mountpoint -H -o value".split() + [ pool_name ] | ||
return call(dbg, cmd).strip() | ||
|
||
def pool_create(dbg, pool_name, devs): | ||
cmd = ("zpool create".split() + [pool_name] # FIXME '-f' ? | ||
+ ['-R', MOUNT_ROOT] | ||
+ devs) | ||
call(dbg, cmd) |