#if not $on
<tr><td>Machine Name:</td><td><input type="text" name="name" value="$defaults.name"/></td></tr>
$errorRow('name', $err)
- <tr><td>Ram:</td><td><input type="text" size=3 name="memory" value="$defaults.memory"/>MB (max $max_mem)</td></tr>
+ <tr><td>Ram:</td><td><input type="text" size=3 name="memory" value="$defaults.memory"/>MiB (max $max_mem)</td></tr>
$errorRow('memory', $err)
- <tr><td>Disk:</td><td><input type="text" size=3 name="disk" value="$defaults.disk"/>GB (max $max_disk)</td><td>WARNING: Modifying disk size may corrupt your data.</td></tr>
+ <tr><td>Disk:</td><td><input type="text" size=3 name="disk" value="$defaults.disk"/>GiB (max $max_disk)</td><td>WARNING: Modifying disk size may corrupt your data.</td></tr>
$errorRow('disk', $err)
#else
$errorRow('name', $err)
name = disk.guest_device_name
disk_fields.extend([(x % name, y % name) for x, y in
disk_fields_template])
- data_dict['%s_size' % name] = "%0.1f GB" % (disk.size / 1024.)
+ data_dict['%s_size' % name] = "%0.1f GiB" % (disk.size / 1024.)
return disk_fields
def command(user, fields):
display_fields = (display_fields[:disk_point] + disk_fields +
display_fields[disk_point+1:])
- main_status['memory'] += ' MB'
+ main_status['memory'] += ' MiB'
for field, disp in display_fields:
if field in ('uptime', 'cputime') and locals()[field] is not None:
fields.append((disp, locals()[field]))
raise ValueError
except ValueError:
raise InvalidInput('memory', memory,
- "Minimum %s MB" % MIN_MEMORY_SINGLE)
+ "Minimum %s MiB" % MIN_MEMORY_SINGLE)
if memory > maxMemory(user, machine, on):
raise InvalidInput('memory', memory,
- 'Maximum %s MB' % maxMemory(user, machine))
+ 'Maximum %s MiB' % maxMemory(user, machine))
return memory
def validDisk(user, disk, machine=None):
raise ValueError
except ValueError:
raise InvalidInput('disk', disk,
- "Minimum %s GB" % MIN_DISK_SINGLE)
+ "Minimum %s GiB" % MIN_DISK_SINGLE)
return disk
def testMachineId(user, machine_id, exists=True):