diff --git a/lvm/index.cgi b/lvm/index.cgi index 013cb5a8b..2a725d757 100755 --- a/lvm/index.cgi +++ b/lvm/index.cgi @@ -156,6 +156,10 @@ if (@vgs) { "".&text('index_addlv2s', $v->{'name'}). ""); + push(@links, + "".&text('index_addlv3', $v->{'name'}). + ""); } } if (!@alllvs) { diff --git a/lvm/lang/en b/lvm/lang/en index bc19b913b..8f687c3f3 100644 --- a/lvm/lang/en +++ b/lvm/lang/en @@ -12,6 +12,7 @@ i2ndex_addpv=Add a physical volume to the group. index_addpv2=Add a physical volume to $1. index_addlv2=Create a logical volume in $1. index_addlv2s=Create a snapshot in $1. +index_addlv3=Create a thin pool in $1. index_addlv=Create a new logical volume. index_addsnap=Create a new snapshot. index_return=volume groups @@ -189,6 +190,14 @@ pvmove_start=Moving logical volume $1 from $2 to $3 .. pvmove_failed=.. move failed! pvmove_done=.. move complete +thin_title=Create Thin Pool +thin_desc=A thin pool is a pair of LVs that can be used to create additional LVs that can be larger than the available extents. Space is only consumed when needed, rather than when the LVs inside the pool are created. +thin_header=New thin pool details +thin_datalv=Existing LV for data +thin_metadatalv=Existing LV for metadata +thin_ok=Convert LVs Into Thin Pool +thin_elvs=No LVs that are not already in use were found in this VG! + log_create_vg=Created volume group $1 log_modify_vg=Modified volume group $1 log_delete_vg=Deleted volume group $1 diff --git a/lvm/thin_form.cgi b/lvm/thin_form.cgi new file mode 100644 index 000000000..3bdda78ed --- /dev/null +++ b/lvm/thin_form.cgi @@ -0,0 +1,41 @@ +#!/usr/local/bin/perl +# Display a form for creating a new thinpool from two LVs + +require './lvm-lib.pl'; +&ReadParse(); +($vg) = grep { $_->{'name'} eq $in{'vg'} } &list_volume_groups(); +$vg || &error($text{'vg_egone'}); + +# Find LVs that aren't in use +my @lvs; +foreach my $lv (&list_logical_volumes($in{'vg'})) { + next if ($lv->{'is_snap'}); + my @stat = &device_status($lv->{'device'}); + next if (@stat); + push(@lvs, $lv); + } +@lvs || &error($text{'thin_elvs'}); +@lvsel = map { [ $_->{'name'}, + $_->{'name'}." (".&nice_size($_->{'size'} * 1024).")" ] } @lvs; + +$vgdesc = &text('lv_vg', $vg->{'name'}); +&ui_print_header($vgdesc, $text{'thin_title'}, ""); + +print $text{'thin_desc'},"
\n"; + +print &ui_form_start("thin_create.cgi", "post"); +print &ui_hidden("vg", $in{'vg'}); +print &ui_table_start($text{'thin_header'}, undef, 2); + +# Data LV +print &ui_table_row($text{'thin_datalv'}, + &ui_select("data", undef, \@lvsel)); + +# Metadata LV +print &ui_table_row($text{'thin_metadatalv'}, + &ui_select("metadata", undef, \@lvsel)); + +print &ui_table_end(); +print &ui_form_end([ [ undef, $text{'thin_ok'} ] ]); + +&ui_print_footer("index.cgi?mode=lvs", $text{'index_return'});