From: keisuke fukawa Date: Thu, 1 Jul 2010 08:48:06 +0000 (+0900) Subject: Change disk layout display X-Git-Tag: v2.0.0^2~118 X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=000df44f4916bb8a5365cce3eaaa77f496190bb5;p=karesansui%2Fkaresansui.git Change disk layout display --- diff --git a/karesansui/gadget/guest.py b/karesansui/gadget/guest.py index c9c92ed..5310cf7 100644 --- a/karesansui/gadget/guest.py +++ b/karesansui/gadget/guest.py @@ -170,14 +170,16 @@ def validates_guest_add(obj): None, ) and check - if is_param(obj.input, 'vm_disk_size'): - check = checker.check_number( - _('Disk Size (MB)'), - obj.input.vm_disk_size, - CHECK_VALID | CHECK_MIN | CHECK_EMPTY, - DISK_MIN_SIZE, - None, - ) and check + if is_param(obj.input, 'pool_type'): + if obj.input.pool_type != "block": + if is_param(obj.input, 'vm_disk_size'): + check = checker.check_number( + _('Disk Size (MB)'), + obj.input.vm_disk_size, + CHECK_VALID | CHECK_MIN | CHECK_EMPTY, + DISK_MIN_SIZE, + None, + ) and check if not is_param(obj.input, 'boot_image'): check = False @@ -424,31 +426,53 @@ class Guest(Rest): if not pools: return web.badrequest('One can not start a storage pool.') - self.view.pools = pools - pools_info = {} - pools_vols_info = {} - - for pool in pools: - pool_obj = self.kvc.search_kvn_storage_pools(pool)[0] - if pool_obj.is_active() is True: - vols_obj = pool_obj.search_kvn_storage_volumes(self.kvc) - vols_info = {} - for vol_obj in vols_obj: - vol_name = vol_obj.get_storage_volume_name() - vols_info[vol_name] = vol_obj.get_info() - - pools_vols_info[pool] = vols_info - - pools_info[pool] = pool_obj.get_info() - - self.view.pools_info = pools_info - self.view.pools_vols_info = pools_vols_info - # Output .input if self.is_mode_input() is True: + self.view.pools = pools + pools_info = {} + pools_vols_info = {} + pools_iscsi_blocks = {} + already_vols = [] + guests = [] + + guests += self.kvc.list_inactive_guest() + guests += self.kvc.list_active_guest() + for guest in guests: + already_vol = self.kvc.get_storage_volume_bydomain(domain=guest, + image_type=None, + attr='path') + if already_vol: + already_vols += already_vol.keys() + + for pool in pools: + pool_obj = self.kvc.search_kvn_storage_pools(pool)[0] + if pool_obj.is_active() is True: + pools_info[pool] = pool_obj.get_info() + + blocks = None + if pools_info[pool]['type'] == 'iscsi': + blocks = self.kvc.get_storage_volume_iscsi_block_bypool(pool) + if blocks: + pools_iscsi_blocks[pool] = [] + vols_obj = pool_obj.search_kvn_storage_volumes(self.kvc) + vols_info = {} + + for vol_obj in vols_obj: + vol_name = vol_obj.get_storage_volume_name() + vols_info[vol_name] = vol_obj.get_info() + if blocks: + if vol_name in blocks and vol_name not in already_vols: + pools_iscsi_blocks[pool].append(vol_obj.get_info()) + + pools_vols_info[pool] = vols_info + + self.view.pools_info = pools_info + self.view.pools_vols_info = pools_vols_info + self.view.pools_iscsi_blocks = pools_iscsi_blocks + bridge_prefix = { "XEN":"xenbr", - "KVM":"(eth|bond)", + "KVM":"(eth|bondbr)", } self.view.host_id = host_id self.view.DEFAULT_KEYMAP = DEFAULT_KEYMAP @@ -586,7 +610,7 @@ class Guest(Rest): guests_json = [] for x in guests: guests_json.append(x.get_json(self.me.languages)) - + self.view.guests = json_dumps(guests_json) else: self.view.exports = exports @@ -604,6 +628,8 @@ class Guest(Rest): model = findbyhost1(self.orm, host_id) + import pdb; pdb.set_trace() + uris = available_virt_uris() if model.attribute == 0 and model.hypervisor == 1: uri = uris["XEN"] @@ -624,8 +650,8 @@ class Guest(Rest): used_mac_addrs = self.kvc.list_used_mac_addr() mem_info = self.kvc.get_mem_info() - if is_param(self.input, "disk_layout") and \ - self.input.disk_layout == "create" and \ + if is_param(self.input, "pool_type") and \ + self.input.pool_type != "block" and \ is_param(self.input, "pool_dir"): target_path = self.kvc.get_storage_pool_targetpath(self.input.pool_dir) if target_path: # disk @@ -668,23 +694,21 @@ class Guest(Rest): options['keymap'] = self.input.keymap is_create = False - if is_param(self.input, "disk_layout"): + if is_param(self.input, "pool_type"): if is_param(self.input, "bus_type"): options['bus'] = self.input.bus_type - if self.input.disk_layout == "create": # create volume + if self.input.pool_type == "dir" or self.input.pool_type == "fs": # create volume is_create = True options['disk-format'] = self.input.disk_format options["storage-pool"] = self.input.pool_dir options["storage-volume"] = options['name'] # default domain name options['disk-size'] = self.input.vm_disk_size - elif self.input.disk_layout == "iscsi": # iscsi volume TODO - if is_param(self.input, "iscsi_pool") and is_param(self.input, "iscsi_volume"): - options["storage-pool"] = self.input.iscsi_pool - options["storage-volume"] = self.input.iscsi_volume - else: - return web.badrequest() + elif self.input.pool_type == "block": # iscsi block device + (iscsi_pool, iscsi_volume) = self.input.pool_dir.split("/", 2) + options["storage-pool"] = iscsi_pool + options["storage-volume"] = iscsi_volume else: return web.badrequest() else: diff --git a/karesansui/gadget/guestby1device.py b/karesansui/gadget/guestby1device.py index 5604807..bb9d51a 100644 --- a/karesansui/gadget/guestby1device.py +++ b/karesansui/gadget/guestby1device.py @@ -56,7 +56,7 @@ class GuestBy1Device(Rest): bridge_prefix = { "XEN":"xenbr", - "KVM":"eth", + "KVM":"eth|bondbr", } model = findbyguest1(self.orm, guest_id) @@ -64,96 +64,101 @@ class GuestBy1Device(Rest): # virt self.kvc = KaresansuiVirtConnection() try: - inactive_pool = [] - active_pool = self.kvc.list_active_storage_pool() - pools = inactive_pool + active_pool - pools.sort() - - if not pools: - return web.badrequest('One can not start a storage pool.') - - self.view.pools = pools - domname = self.kvc.uuid_to_domname(model.uniq_key) - if not domname: return web.notfound() - + if not domname: + return web.notfound() virt = self.kvc.search_kvg_guests(domname)[0] - guest = MergeGuest(model, virt) + self.view.guest = guest - try: - VMType = guest.info["virt"].get_info()["VMType"].upper() - except: - VMType = "KVM" - - phydev = [] - phydev_regex = re.compile(r"%s" % bridge_prefix[VMType]) - - for dev,dev_info in get_ifconfig_info().iteritems(): + # Output .input + if self.is_mode_input() is True: try: - if phydev_regex.match(dev): - phydev.append(dev) + VMType = guest.info["virt"].get_info()["VMType"].upper() except: - pass - if len(phydev) == 0: - phydev.append("%s0" % bridge_prefix[VMType]) - - phydev.sort() - self.view.phydev = phydev # Physical device - self.view.virnet = sorted(self.kvc.list_active_network()) # Virtual device - self.view.mac_address = generate_mac_address() # new mac address - self.view.ifinfo = virt.get_interface_info() # interface info - self.view.guest = guest # virt obj off - self.view.VMType = VMType - if VMType == "KVM": - self.view.DISK_FORMATS = DISK_QEMU_FORMAT - else: - self.view.DISK_FORMATS = DISK_NON_QEMU_FORMAT - - self.view.bus_types = self.kvc.bus_types - - # iscsi block device list - network_storages = get_iscsi_cmd(self, host_id) - if network_storages is False: - self.logger.debug("Get iSCSI command failed. Return to timeout") - return web.internalerror('Internal Server Error. (Timeout)') - - self.view.network_storages = network_storages - - #iscsi_pools = {} - #for pool in pools: - # pool_obj = self.kvc.search_kvn_storage_pools(pool)[0] - # pool_info = pool_obj.get_info() - # if pool_obj.is_active() is True and pool_info['type'] == 'iscsi': - # vols_obj = pool_obj.search_kvn_storage_volumes(self.kvc) - # vols_info = [] - # for vol_obj in vols_obj: - # vols_info.append(vol_obj.get_info()) - # - # iscsi_pools[pool] = {"info" : pool_obj.get_info(), - # "vols" : vols_info, - # } - #self.view.iscsi_pools = iscsi_pools - - # os pool info - os_pool = self.kvc.get_storage_pool_name_bydomain(domname, "os") - if not os_pool: - return web.badrequest(_("Was found that the guest are using storage pools.")) - self.view.os_pool = os_pool[0] - - #self.view.pool_info = self.kvc.search_kvn_storage_pools(os_pool[0])[0].get_info() - pools_info = [] - for pool in self.kvc.search_kvn_storage_pools(): - pools_info.append(pool.get_info()) - self.view.pools_info = pools_info - - # disk - self.view.disk_info = virt.get_disk_info() # Disk info - - #from karesansui.lib.utils import preprint_r - #preprint_r(self.view.pools_info) - #preprint_r(self.view.pools_vols_info) - #import pdb; pdb.set_trace() + VMType = "KVM" + + self.view.VMType = VMType + + # Network + phydev = [] + phydev_regex = re.compile(r"%s" % bridge_prefix[VMType]) + + for dev,dev_info in get_ifconfig_info().iteritems(): + try: + if phydev_regex.match(dev): + phydev.append(dev) + except: + pass + if len(phydev) == 0: + phydev.append("%s0" % bridge_prefix[VMType]) + + phydev.sort() + self.view.phydev = phydev # Physical device + self.view.virnet = sorted(self.kvc.list_active_network()) # Virtual device + self.view.mac_address = generate_mac_address() # new mac address + + # Disk + inactive_pool = [] + active_pool = self.kvc.list_active_storage_pool() + pools = inactive_pool + active_pool + pools.sort() + + if not pools: + return web.badrequest('One can not start a storage pool.') + + pools_info = {} + pools_vols_info = {} + pools_iscsi_blocks = {} + already_vols = [] + guests = [] + + guests += self.kvc.list_inactive_guest() + guests += self.kvc.list_active_guest() + for guest in guests: + already_vol = self.kvc.get_storage_volume_bydomain(domain=guest, + image_type=None, + attr='path') + if already_vol: + already_vols += already_vol.keys() + + for pool in pools: + pool_obj = self.kvc.search_kvn_storage_pools(pool)[0] + if pool_obj.is_active() is True: + pools_info[pool] = pool_obj.get_info() + + blocks = None + if pools_info[pool]['type'] == 'iscsi': + blocks = self.kvc.get_storage_volume_iscsi_block_bypool(pool) + if blocks: + pools_iscsi_blocks[pool] = [] + vols_obj = pool_obj.search_kvn_storage_volumes(self.kvc) + vols_info = {} + + for vol_obj in vols_obj: + vol_name = vol_obj.get_storage_volume_name() + vols_info[vol_name] = vol_obj.get_info() + if blocks: + if vol_name in blocks and vol_name not in already_vols: + pools_iscsi_blocks[pool].append(vol_obj.get_info()) + + pools_vols_info[pool] = vols_info + + self.view.pools = pools + self.view.pools_info = pools_info + self.view.pools_vols_info = pools_vols_info + self.view.pools_iscsi_blocks = pools_iscsi_blocks + + if VMType == "KVM": + self.view.DISK_FORMATS = DISK_QEMU_FORMAT + else: + self.view.DISK_FORMATS = DISK_NON_QEMU_FORMAT + + self.view.bus_types = self.kvc.bus_types + + else: # .part + self.view.ifinfo = virt.get_interface_info() # interface info + self.view.disk_info = virt.get_disk_info() # Disk info finally: self.kvc.close() @@ -209,8 +214,9 @@ class GuestBy1Device(Rest): volume_job = None order = 0 - if self.input.disk_layout == "create": # create(dir) + if self.input.pool_type == "dir" or self.input.pool_type == "fs": # create(dir) disk_type = 'file' + pool_name = self.input.pool_dir volume_name = string_from_uuid(generate_uuid()) volume_job = create_storage_volume_dir(self, model, @@ -224,13 +230,12 @@ class GuestBy1Device(Rest): order) order += 1 - pool_name = self.input.pool_dir - elif self.input.disk_layout == "iscsi": # create(iscsi block) + elif self.input.pool_type == "block": # create(iscsi block) disk_type = 'iscsi' - pool_name = self.input.pool_dir - target_storage = kvc.get_storage_volume_iscsi_bysymlink(self.input.iscsi_block) - pool_name = target_storage['pool'] - volume_name = target_storage['volume'] + (iscsi_pool, iscsi_volume) = self.input.pool_dir.split("/", 2) + pool_name = iscsi_pool + volume_name = iscsi_volume + else: return badrequest(_("No storage type specified.")) diff --git a/karesansui/lib/virt/virt.py b/karesansui/lib/virt/virt.py index 383976c..22f6f87 100644 --- a/karesansui/lib/virt/virt.py +++ b/karesansui/lib/virt/virt.py @@ -2892,6 +2892,46 @@ class KaresansuiVirtConnection: break return ret + def get_storage_volume_iscsi_block_bypool(self, pool): + """ + ストレージプールの名前からiSCSIブロックデバイスのボリュームの一覧を取得する + @param pool: プール名 + @return: ストレージボリューム名の配列 + @rtype: dict + + + TODO: English Comment + + """ + retval = [] + + try: + inactive_pool = self.list_inactive_storage_pool() + active_pool = self.list_active_storage_pool() + pools = inactive_pool + active_pool + + pool_obj = self.search_kvn_storage_pools(pool)[0] + if not pool_obj: + raise KaresansuiVirtException(_("No storage pool '%s' could be found.") % pool) + + vols = pool_obj.vol_listVolumes() + for vol in vols: + vol_obj = pool_obj.vol_storageVolLookupByName(vol) + vol_key = vol_obj.key() + vol_key = vol_key.replace("%s/" % (ISCSI_DEVICE_DIR), "") + regex = re.compile(r"^%s" % (re.escape(vol_key))) + is_mount = False + for pool in pools: + if regex.match(pool): + is_mount = True + + if is_mount is False: + retval.append(vol) + except: + pass + + return retval + class KaresansuiVirtGuest: diff --git a/karesansui/static/css/device.css b/karesansui/static/css/device.css index d1e516e..88eff37 100644 --- a/karesansui/static/css/device.css +++ b/karesansui/static/css/device.css @@ -26,3 +26,33 @@ background-color: #a9cf15; } +#input_device .grayout-detail { + border: 1px solid #BCBCBC; + width: 100%; + margin: 5px 0px; +} +#input_device .detail-contents { + width: 100%; +} +#input_device .detail-separator{ + height:18px; + width:60px; +} +#input_device .detail-space { + background:transparent url(${ctx.homepath}/static/images/kugiri-a.gif) repeat scroll 0 0; + height:4px; + margin-bottom:8px; + margin-top:8px; + width:100%; +} +#input_device table.detail-contents>tbody>tr>th{ + font-weight: bold; + background-color: #FFFFFF; + padding:0px 10px; + width:20%; + text-align: left; + white-space: nowrap; +} +#input_device table.detail-contents>tbody>tr>td{ + background-color: #FFFFFF; +} diff --git a/karesansui/static/css/guest.css b/karesansui/static/css/guest.css index 0df2a35..19dc6b8 100644 --- a/karesansui/static/css/guest.css +++ b/karesansui/static/css/guest.css @@ -93,3 +93,34 @@ margin-left:12px; width:95%; } + +#input_guest .grayout-detail { + border: 1px solid #BCBCBC; + width: 100%; + margin: 5px 0px; +} +#input_guest .detail-contents { + width: 100%; +} +#input_guest .detail-separator{ + height:18px; + width:60px; +} +#input_guest .detail-space { + background:transparent url(${ctx.homepath}/static/images/kugiri-a.gif) repeat scroll 0 0; + height:4px; + margin-bottom:8px; + margin-top:8px; + width:100%; +} +#input_guest table.detail-contents>tbody>tr>th{ + font-weight: bold; + background-color: #FFFFFF; + padding:0px 10px; + width:20%; + text-align: left; + white-space: nowrap; +} +#input_guest table.detail-contents>tbody>tr>td{ + background-color: #FFFFFF; +} diff --git a/karesansui/templates/default/guest/guest.input b/karesansui/templates/default/guest/guest.input index fe516dd..78f556e 100644 --- a/karesansui/templates/default/guest/guest.input +++ b/karesansui/templates/default/guest/guest.input @@ -187,21 +187,23 @@ function show_element(id,flag) { } $(document).ready(function(){ - // TODO: ストレージプール毎に最大値等を設定する set_simple_slider("#disk_slider", "#vm_disk_size", 0, ${int(pools_info['default']['available']) / (1024 * 1024)}, ${int(pools_info['default']['available']) / (1024 * 1024)}); $("#pool_dir").change(function(){ var pool_name = $('option:selected', this).val(); var disk_type = $('option:selected', this).parent('optgroup').attr('label'); + $("#pool_type").val(disk_type); if(disk_type == 'block'){ - var parts = pool_name.split("_"); + var parts = pool_name.split("/"); var vol_name = parts[1]; var vols_info = new Array(); -% for pool_name in sorted(pools_vols_info.keys()): -% for vol_name in sorted(pools_vols_info[pool_name].keys()): +% for pool_name in pools_iscsi_blocks.keys(): +% for vol_info in pools_iscsi_blocks[pool_name]: var vol_info = new Array(); - vol_info['capacity'] = "${pools_vols_info[pool_name][vol_name]['capacity']}"; - vols_info["${vol_name}"] = vol_info; + vol_info['capacity'] = "${vol_info['capacity']}"; + vol_info['path'] = "${vol_info['target']['path']}"; + vol_info['realpath'] = "${vol_info['real']['dir']}/${vol_info['real']['name']}"; + vols_info["${vol_info['name']}"] = vol_info; % endfor % endfor var disk_capacity = Math.floor(vols_info[vol_name]['capacity'] / (1024 * 1024)); @@ -210,6 +212,10 @@ $(document).ready(function(){ $("#disk_available_box").hide(); $("#disk_capacity_value_box").html(disk_capacity); $("#disk_format_box").hide(); + $("#disk_path_value_box").html(vols_info[vol_name]['path']); + $("#disk_realpath_value_box").html(vols_info[vol_name]['realpath']); + $("#disk_path_box").show(); + $("#disk_realpath_box").show(); } else { // type is 'dir' or 'fs' var pools_info = new Array(); % for pool_name in pools_info.keys(): @@ -227,16 +233,13 @@ $(document).ready(function(){ $("#disk_available_value_box").html(disk_available); $("#disk_capacity_value_box").html(disk_capacity); $("#disk_format_box").show(); - } - - }); - - $("#pool_iscsi_list").tablesorter({ - widgets: ['zebra', 'select'], - headers: { - 0: {sorter:false} + $("#disk_path_box").hide(); + $("#disk_realpath_box").hide(); } + }); + $("#disk_path_box").hide(); + $("#disk_realpath_box").hide(); setDefaultValue(); $("#mem_slider").slider({ @@ -265,34 +268,21 @@ $(document).ready(function(){ validates_guest ); - - $("tr[id*='pool_iscsi_row_']").each(function(){ - $(this).one('click.once', function(){ - var selc = $(this).attr("id").replace("pool_iscsi_row_", "").split("_"); - var pool = selc[0]; - var volume = selc[1]; - - $("#iscsi_pool").attr("value", pool); - $("#iscsi_volume").attr("value", volume); - //selected_row() - }); - }); - //help - helptip("#guest_name_help", - "${_('Guest Name')}", + helptip("#guest_name_help", + "${_('Guest Name')}", "${_('Name of the guest. This will be used in Karesansui control panel. Any letters, including spaces and symbols are allowed.')}"); - helptip("#guest_domain_name_help", - "${_('Domain Name')}", + helptip("#guest_domain_name_help", + "${_('Domain Name')}", "${_(r'VM domain name of the guest. This will be used to distinguish each guests in VM, so it should be unique between all guests (This is NOT a DNS \"domain\"). Alphabets and some symbols are allowed.')}"); - helptip("#guest_icon_help", - "${_('Guest Icon')}", + helptip("#guest_icon_help", + "${_('Guest Icon')}", "${_('Icon image to be used in Karesansui control panel. Choose the file and click upload button.')}"); - helptip("#guest_memory_help", - "${_('Memory Size')}", + helptip("#guest_memory_help", + "${_('Memory Size')}", "${_('The amount of RAM for the guest to use (in mega-bytes).')}"); // TRANSLATORS: @@ -385,40 +375,40 @@ qcow2: Qemu is the most common image formats supported. "${_('VNC Keymap')}", "${_('Keymap of the keyboard to use with VNC.')}"); - helptip("#guest_disk_help", - "${_('Disk Size')}", + helptip("#guest_disk_help", + "${_('Disk Size')}", "${_('Size of the disk of the guest (MB)')}"); - helptip("#guest_kernel_help", - "${_('Kernel Image')}", + helptip("#guest_kernel_help", + "${_('Kernel Image')}", "${_('Kernel image for the guest. Specify FTP/HTTP URL, or a valid absolute file path.')}"); - - helptip("#guest_initrd_help", - "${_('Initrd Image')}", + + helptip("#guest_initrd_help", + "${_('Initrd Image')}", "${_('The initrd (bootup RAM disk) image for the guest. Specify FTP/HTTP URL, or a valid absolute file path.')}"); - helptip("#guest_iso_help", - "${_('ISO Image')}", + helptip("#guest_iso_help", + "${_('ISO Image')}", "${_('The ISO 9660 CD-ROM/DVD-ROM image for the guest. Specify a valid absolute file path.')}"); - helptip("#guest_vnc_port_help", - "${_('VNC Port Number')}", + helptip("#guest_vnc_port_help", + "${_('VNC Port Number')}", "${_('(Auto-recommended value displayed below.) TCP port number to access the guest with VNC. Numbers greater than 5900 are allowed. Unique number between all guests are recommended.')}"); - helptip("#guest_interface_type_help", - "${_('Interface Type')}", + helptip("#guest_interface_type_help", + "${_('Interface Type')}", "${_(r'Type of the virtual network interface connection. Choose \"Physical Device\" to connect directly to the physical network, or \"Virtual Network\" to connect guest to the virtual network (which are in \"Network\" tab of the host). ')}"); - helptip("#guest_mac_address_help", - "${_('MAC Address')}", + helptip("#guest_mac_address_help", + "${_('MAC Address')}", "${_('(Auto-recommended value displayed below.) MAC address of the guest in xx:xx:xx:xx:xx:xx format. Specify an address not used in the network.')}"); - helptip("#guest_option_help", - "${_('Extra Kernel Options')}", + helptip("#guest_option_help", + "${_('Extra Kernel Options')}", "${_('Kernel parameters to pass to the guest kernel on guest installation.')}"); - helptip("#guest_tag_help", - "${_('Tag')}", + helptip("#guest_tag_help", + "${_('Tag')}", "${_(r'Tag to add to the guest to be used in Karesansui control panel. Can be used to search guests using tags in the \"Guests\" panel. Separate tags with commas to specify two or more tags. Any letters, including spaces and symbols are allowed.')}"); }); // --> @@ -431,7 +421,7 @@ qcow2: Qemu is the most common image formats supported.
- +
${_('Guest Name')}
@@ -473,43 +463,8 @@ qcow2: Qemu is the most common image formats supported.
${_('Storage Type')}
- ${_("Storage Pool Name")} : 
- - + @@ -582,6 +538,16 @@ TODO: iscsiのストレージプールを表示させない。dir, fsのみ表 + + + + + + + + + +
${_('Storage Pool Type')}
${_('Device Path')}
${_('Device Real Path')}
@@ -592,17 +558,17 @@ TODO: iscsiのストレージプールを表示させない。dir, fsのみ表 % if "KVM" in hypervisors.keys(): % for x in bus_types: % if x == "virtio": - + % else: - + % endif % endfor % else: % for x in bus_types: % if x == "xen": - + % else: - + % endif % endfor % endif @@ -654,7 +620,7 @@ TODO: iscsiのストレージプールを表示させない。dir, fsのみ表 ${_('ISO Image')}
- ${_('Require')} + ${_('Require')} @@ -746,5 +712,5 @@ TODO: iscsiのストレージプールを表示させない。dir, fsのみ表

- + diff --git a/karesansui/templates/default/guestby1device/guestby1device.input b/karesansui/templates/default/guestby1device/guestby1device.input index 58d5914..ce98c91 100644 --- a/karesansui/templates/default/guestby1device/guestby1device.input +++ b/karesansui/templates/default/guestby1device/guestby1device.input @@ -4,99 +4,130 @@ @@ -200,103 +213,103 @@ if("${VMType}" == "KVM") {
${_('Storage Type')}
- ${_("Create new disk image")} - ${_("Use iSCSI")} - -
-
- TODO : sparse - - - - - - - - - - - + + + + + + + + + + +
${_("Storage Name")}${_("Available")}${_("Capacity")}${_("Disk Size (MB)")}${_("Image Type")}
+% for group_type in ['dir', 'fs', 'block']: + +% for name in sorted(pools_info.keys()): +% if group_type == 'dir' and pools_info[name]['type'] == 'dir': +% if pools_info[name]['name'] == 'default': + +% else: + +% endif +% endif + +% if group_type == 'fs' and pools_info[name]['type'] == 'fs': + +% endif + +% if group_type == 'block' and pools_info[name]['type'] == 'iscsi': +% if name in pools_iscsi_blocks: +% for vol_info in pools_iscsi_blocks[name]: + +% endfor +% endif +% endif +% endfor + % endfor - TODO : ${view_autounit(pools_info[0]['available'])}TODO : ${view_autounit(pools_info[0]['capacity'])} + +
+ + + + + + + + + + + - + + + + + + + + + + + + + + -
${_('Storage Pool Type')}${pools_info['default']['type'] | h}
${_('Disk Size (MB)')}
- ${_('Require')} + ${_('Require')}
+
${_('Available (MB)')}${int(pools_info['default']['available']) / (1024 * 1024)}
${_('Capacity (MB)')}${int(pools_info['default']['capacity']) / (1024 * 1024)}
${_('OS Image Type')}
-
- - -
-
- -% for iscsi in network_storages: - - - - - - - - - -% for disk in iscsi['disk_list']: -% if disk['is_blockable'] is True: - - - - -% endif -% endfor - -
${_('Name')}${_('Device Name')}
-% endfor -
+
${_('Device Path')}
${_('Device Real Path')}
-
${_('Disk Device Type')}
-
- % for x in bus_types: - +% if x == "virtio": + +% else: + +% endif % endfor - -
+ +