Git repository of Karesansui.
Revision | 0d08ffbc7d6a129e789f91a010f26bad5ab52df3 (tree) |
---|---|
Time | 2010-07-22 21:10:40 |
Author | Junichi Shinohara <junichi@kare...> |
Commiter | Junichi Shinohara |
Merge branch 'dev' of ssh://raid.local.hde.co.jp/hde/karesansui/karesansui into dev
@@ -169,9 +169,10 @@ class CreateGuest(KssCommand): | ||
169 | 169 | if not (opts.storage_pool in active_storage_pools or opts.storage_pool in inactive_storage_pools): |
170 | 170 | raise KssCommandException('Storage pool does not exist. - pool=%s' % (opts.storage_pool)) |
171 | 171 | |
172 | - if conn.get_storage_volume(opts.storage_pool, opts.storage_volume) is None: | |
173 | - raise KssCommandException('Specified storage volume does not exist. - pool=%s, vol=%s' | |
174 | - % (opts.pool_name, opts.name)) | |
172 | + # TODO | |
173 | + #if conn.get_storage_volume(opts.storage_pool, opts.uuid) is None: | |
174 | + # raise KssCommandException('Specified storage volume does not exist. - pool=%s, vol=%s' | |
175 | + # % (opts.storage_pool, opts.uuid)) | |
175 | 176 | |
176 | 177 | try: |
177 | 178 | self.up_progress(10) |
@@ -193,7 +194,7 @@ class CreateGuest(KssCommand): | ||
193 | 194 | disk_format=opts.disk_format, |
194 | 195 | storage_pool=opts.storage_pool, |
195 | 196 | storage_volume=opts.storage_volume, |
196 | - ): | |
197 | + ) is True: | |
197 | 198 | raise KssCommandException('Failed to create guest. - dom=%s' % (opts.name)) |
198 | 199 | |
199 | 200 | except Exception, e: |
@@ -726,6 +726,14 @@ def process_start_service(opts,p_callback=None): | ||
726 | 726 | except: |
727 | 727 | pass |
728 | 728 | |
729 | + """touch files | |
730 | + You should add path of file that is expected to be touched to following list | |
731 | + """ | |
732 | + touch_files = ["/var/log/hde-collectd/alert.log"] | |
733 | + touch_files = [] | |
734 | + for _file in touch_files: | |
735 | + if not os.path.exists(_file) and os.path.exists(os.path.dirname(_file)): | |
736 | + open(_file, 'w').close() | |
729 | 737 | |
730 | 738 | time.sleep(1) |
731 | 739 | write_log(_("Leaving '%s'") % sys._getframe(0).f_code.co_name) |
@@ -857,6 +857,8 @@ class KaresansuiVirtConnection: | ||
857 | 857 | except: |
858 | 858 | pass |
859 | 859 | |
860 | + return True | |
861 | + | |
860 | 862 | def start_guest(self,name=None): |
861 | 863 | """ |
862 | 864 | <comment-ja> |
@@ -239,7 +239,7 @@ function set_pool_name(name){ | ||
239 | 239 | if(disk_type == 'iscsi'){ |
240 | 240 | var vol_name = null; |
241 | 241 | if(parts.length > 1){ |
242 | - var vol_name = parts[1]; | |
242 | + vol_name = parts[1]; | |
243 | 243 | } |
244 | 244 | var disk_capacity = view_megaunit(vols_info[vol_name]['capacity'], 'B'); |
245 | 245 | var view_disk_capacity = view_autounit(vols_info[vol_name]['capacity'], null, DEFAULT_DECIMAL_POINT, true); |
@@ -253,6 +253,7 @@ function set_pool_name(name){ | ||
253 | 253 | $("#disk_realpath_value_box").html(vols_info[vol_name]['realpath']); |
254 | 254 | $("#disk_path_box").show(); |
255 | 255 | $("#disk_realpath_box").show(); |
256 | + $("#pool_type").val("block"); | |
256 | 257 | } else { // type is 'dir' or 'fs' |
257 | 258 | var disk_available = view_megaunit(pools_info[pool_name]['available'], 'B'); |
258 | 259 | var disk_capacity = view_megaunit(pools_info[pool_name]['capacity'], 'B'); |
@@ -263,7 +264,7 @@ function set_pool_name(name){ | ||
263 | 264 | var view_start_disk_size = default_view_start_disk_size; |
264 | 265 | if(disk_available < default_start_disk_size){ |
265 | 266 | start_disk_size = disk_available; |
266 | - view_start_disk_size = view_autounit(start_disk_size, ['MB','GB','TB', 'PB', 'EB'], DEFAULT_DECIMAL_POINT, true) | |
267 | + view_start_disk_size = view_autounit(start_disk_size, ['MB','GB','TB', 'PB', 'EB'], DEFAULT_DECIMAL_POINT, true); | |
267 | 268 | } |
268 | 269 | $("#disk_size_box").show(); |
269 | 270 | set_simple_slider( |
@@ -287,6 +288,7 @@ function set_pool_name(name){ | ||
287 | 288 | $("#disk_format_box").show(); |
288 | 289 | $("#disk_path_box").hide(); |
289 | 290 | $("#disk_realpath_box").hide(); |
291 | + $("#pool_type").val(disk_type); | |
290 | 292 | } |
291 | 293 | } |
292 | 294 |
@@ -313,7 +315,6 @@ $(document).ready(function(){ | ||
313 | 315 | $("#vm_mem_size_autounit").text('(' + view_value + ')'); |
314 | 316 | }); |
315 | 317 | |
316 | - | |
317 | 318 | var pool_name = $('#pool_dir option:selected').val(); |
318 | 319 | set_pool_name(pool_name); |
319 | 320 | $("#pool_dir").change(function(){ |