1 #from skeleton import skeleton
2 #from invirt.config import structs as config
15 <h2>Create a new VM</h2>
17 <p class="error">We had a problem with your request:</p>
18 #else if $varExists('new_machine')
19 <p>Congratulations! You successfully created a new VM called $new_machine.</p>
21 <form action="create" method="POST">
22 <input type="hidden" name="back" value="list"/>
25 $errorRow('create', $err)
29 <td><input type="text" name="name" value="$defaults.name"/>.${config.dns.domains[0]}</td>
32 $errorRow('name', $err)
36 <td><textarea name="description" rows="4" cols="60">$defaults.description</textarea></td>
39 $errorRow('description', $err)
43 <td><input type="text" name="memory" value="$defaults.memory" size=3/> MiB ($max_memory max)</td>
46 $errorRow('memory', $err)
50 <td><input type="text" name="disksize" value="$defaults.disk" size=3/> GiB (${"%0.1f" % ($max_disk-0.05)} max)</td>
53 $errorRow('disk', $err)
58 $helppopup('HVM/ParaVM')#slurp
63 $vmTypeList($defaults.type)
68 $errorRow('vmtype', $err)
71 $errorRow('autoinstall', $err)
76 $helppopup('Autoinstall')#slurp
79 <td><input type="radio" name="cd_or_auto" id="cd_or_auto_auto">
81 $autoList($defaults.cdrom, "document.getElementById('cd_or_auto_auto').checked = true;document.getElementById('cdromlist').value = ''")
82 (experimental; 1-2 minutes, and you have a machine with empty root password.)
88 <td><input type="radio" name="cd_or_auto" id="cd_or_auto_cd" checked>
90 $cdromList($defaults.cdrom, "document.getElementById('cd_or_auto_cd').checked = true;document.getElementById('autoinstalllist').value = ''")
95 $errorRow('cdrom', $err)
96 $errorRow('cdrom', $err)
99 <td><input type="text" name="owner" value="$defaults.owner"/></td>
102 $errorRow('owner', $err)
105 <input type="submit" class="button" value="Create it!"/><br />
106 Windows notes: #slurp
108 $helppopup('Windows')#slurp
114 #def machineRow($machine)
117 <form action="command" method="post">
118 <input type="hidden" name="back" value="list"/>
119 <input type="hidden" name="machine_id"
120 value="$machine.machine_id"/>
121 <input type="submit" class="power #slurp
122 #if $machine.uptime then 'on' else 'off'
123 " name="action" value="#slurp
124 #if $machine.uptime then 'Power off' else 'Power on'
128 <td><a href="info?machine_id=$machine.machine_id">$machine.name</a></td>
129 <td>${machine.memory}M</td>
130 <td>$machine.owner</td>
131 <td>$machine.administrator</td>
133 #set $nic = $machine.nics[0]
140 ${datetime.timedelta(seconds=int(machine.uptime))}#slurp
144 #if $has_vnc[$machine] == True
145 <a href="vnc?machine_id=$machine.machine_id">Console</a>#slurp
146 #else if $has_vnc[$machine] != 'Off'
154 <td colspan="7" style="padding-left: 1em; color: #666">$machine.description</td>
158 #def machineList($machines)
159 <table cellspacing="0" cellpadding="2">
166 $helppopup('Owner')#slurp
169 <th>Administrator#slurp
171 $helppopup('Administrator')#slurp
178 #for $machine in $machines:
180 $machineRow($machine)
184 <script type="text/javascript" src="/static/stripe.js"></script>
185 <script type="text/javascript">
186 document.observe("dom:loaded", function() {
187 stripe(\$('machinelist').getElementsByTagName('table')[0],
195 <p style="font-size: 125%;"><a href="http://${config.web.hostname}">What is XVM?</a></p>
197 <p>You don't currently control any VMs.</p>
199 <p><a href="list">refresh</a></p>
200 <div id="machinelist">
202 $machineList($machines)