Skip to content

Commit

Permalink
Merge branch 'lvm-vs-ext'
Browse files Browse the repository at this point in the history
  • Loading branch information
ydirson committed Apr 19, 2024
2 parents a43ced8 + 0eef246 commit 3ed38a7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion answerfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def parseDisks(self):
if SR_TYPE_LARGE_BLOCK and len(large_block_disks) > 0:
default_sr_type = SR_TYPE_LARGE_BLOCK
else:
default_sr_type = SR_TYPE_LVM
default_sr_type = SR_TYPE_EXT

sr_type = getMapAttribute(self.top_node,
['sr-type', 'srtype'],
Expand Down
6 changes: 5 additions & 1 deletion doc/answerfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,14 @@ Format of 'source' and 'driver-source'

Local SR type.

Default: lvm if the disks included in local SR storage all have 512 byte
Default: ext if the disks included in local SR storage all have 512 byte
logical blocks, otherwise (when available) the SR type from
the large-block-capable-sr-type feature

Note that while it reflects the default choice in the text UI,
this differs from XenServer and from XCP-ng releases lower than
8.3, where the default was "lvm".


Upgrade Elements
----------------
Expand Down
15 changes: 8 additions & 7 deletions tui/installer/screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,13 +830,14 @@ def get_sr_type(answers):
for disk in guest_disks)

if not need_large_block_sr_type or not constants.SR_TYPE_LARGE_BLOCK:
srtype = answers.get('sr-type', constants.SR_TYPE_LVM)
txt = "Enable thin provisioning"
if len(BRAND_VDI) > 0:
txt += " (Optimized storage for %s)" % BRAND_VDI
tb = Checkbox(txt, srtype == constants.SR_TYPE_EXT and 1 or 0)
content = tb
get_type = lambda: tb.selected() and constants.SR_TYPE_EXT or constants.SR_TYPE_LVM
srtype = answers.get('sr-type', constants.SR_TYPE_EXT)
rb = RadioBar(tui.screen, (("EXT: file based. Thin provisioning.",
constants.SR_TYPE_EXT, srtype == constants.SR_TYPE_EXT),
("LVM: block based. Thick provisioning.",
constants.SR_TYPE_LVM, srtype == constants.SR_TYPE_LVM),
))
content = rb
get_type = lambda: rb.getSelection()
buttons = ButtonBar(tui.screen, [('Ok', 'ok'), ('Back', 'back')])
else:
content = TextboxReflowed(40,
Expand Down

0 comments on commit 3ed38a7

Please sign in to comment.