1 #from skeleton import skeleton
14 <h2>Create a new VM</h2>
16 <p class="error">We had a problem with your request:</p>
17 #else if $varExists('new_machine')
18 <p>Congratulations! You successfully created a new VM called $new_machine.</p>
20 <form action="create" method="POST">
21 <input type="hidden" name="back" value="list"/>
24 $errorRow('create', $err)
28 <td><input type="text" name="name" value="$defaults.name"/></td>
31 $errorRow('name', $err)
35 <td><input type="text" name="memory" value="$defaults.memory" size=3/> MiB ($max_memory max)</td>
38 $errorRow('memory', $err)
42 <td><input type="text" name="disk" value="$defaults.disk" size=3/> GiB (${"%0.1f" % ($max_disk-0.05)} max)</td>
45 $errorRow('disk', $err)
50 $helppopup('HVM/ParaVM')#slurp
55 $vmTypeList($defaults.type)
60 $errorRow('vmtype', $err)
64 <td><input type="checkbox" name="clone_from" id="clone_from" value="ice3" onchange="onclone(event)"/>
65 (experimental; 1-2 minutes, and you have an etch machine; root pw is 'password'.)
66 <script type='text/javascript'>function onclone(e){ document.getElementById('cdromlist').value = ''; }</script></td>
69 $errorRow('autoinstall', $err)
74 $helppopup('Autoinstall')#slurp
77 <td><input type="radio" name="cd_or_auto" id="cd_or_auto_auto">
79 $autoList($defaults.cdrom, "document.getElementById('cd_or_auto_auto').checked = true;document.getElementById('cdromlist').value = ''")
80 (experimental; 1-2 minutes, and you have a machine; root pw is 'password'.)
86 <td><input type="radio" name="cd_or_auto" id="cd_or_auto_cd" checked>
88 $cdromList($defaults.cdrom, "document.getElementById('cd_or_auto_cd').checked = true;document.getElementById('autoinstalllist').value = ''")
93 $errorRow('cdrom', $err)
94 $errorRow('cdrom', $err)
97 <td><input type="text" name="owner" value="$defaults.owner"/></td>
100 $errorRow('owner', $err)
103 <input type="submit" class="button" value="Create it!"/>
108 #def machineRow($machine)
110 <td><a href="info?machine_id=$machine.machine_id">$machine.name</a></td>
111 <td>${machine.memory}M</td>
112 <td>$machine.owner</td>
113 <td>$machine.administrator</td>
115 #set $nic = $machine.nics[0]
122 ${datetime.timedelta(seconds=int(machine.uptime))}#slurp
126 #if $has_vnc[$machine] == True
127 <a href="vnc?machine_id=$machine.machine_id">Console</a>#slurp
128 #else if $has_vnc[$machine] != 'Off'
135 <form action="command" method="post">
136 <input type="hidden" name="back" value="list"/>
137 <input type="hidden" name="machine_id"
138 value="$machine.machine_id"/>
139 <input type="submit" class="button" name="action" value="#slurp
140 #if $machine.uptime then 'Power off' else 'Power on'
147 #def machineList($machines)
154 $helppopup('Owner')#slurp
157 <th>Administrator#slurp
159 $helppopup('Administrator')#slurp
167 #for $machine in $machines:
169 $machineRow($machine)
177 <p style="font-size: 125%;">SIPB Virtual Servers is an <strong>alpha service</strong>. <a href="/static/about.html">What does this mean?</a></p>
179 <p>You don't currently control any VMs.</p>
181 <p><a href="list">refresh</a></p>
182 <div id="machinelist">
184 $machineList($machines)