Jump to content

Proxmox Module - Re-Install Service - Storage Variable


omaticon

Recommended Posts

The Proxmox module does not support cases where templates are stored in a different storage zone than the zone the VMs are configured to be created in.  As I don't have the time right now to investigate how to properly fix this I had to hack the following function.  I hope this helps others and gets the issue resolved in a coming update.

 

/**
* Retrieves a list of the virtual server templates
*
* @param string $node The node of the server
* @param stdClass $module_row A stdClass object representing a single server
* @return stdClass An stdClass object representing the server templates
*/
private function getServerTemplates($node, $module_row) {
$api = $this->getApi($module_row->meta->user, $module_row->meta->password, $module_row->meta->host, $module_row->meta->port);
 
// Load the nodes API
$api->loadCommand("proxmox_nodes");
$response = null;
 
try {
$node_api = new ProxmoxNodes($api);
$params = array('node' => $node, 'storage' => $module_row->meta->storage);
 
$this->log($module_row->meta->host . "|vserver-templates", serialize($params), "input", true);
$response = $this->parseResponse($node_api->storageContent($params), $module_row);
}
catch (Exception $e) {
// Nothing to do
}
 
$result = array();
foreach($response->data as $file) {
if($file->content == "vztmpl")
$result[$file->volid] = $file->volid;
}
return $result;
}
 
The hack:
 
$params = array('node' => $node, 'storage' => "local");
 
Regards,
Chris
Link to comment
Share on other sites

Tyson,

 

All you need to do is create multiple storage locations inside Proxmox.  Specify one as the location that hosts ISOs & templates.  Specify the other(s) as locations to store containers and images.  In the Proxmox module included in Blesta there is a "default storage location."  If you specify one of the storage locations configured to store containers or images then the module will never fill the templates drop down in the client's "re-install" view because the templates do not exist in the same location as the one specified in the "default storage location."

Link to comment
Share on other sites

naja7host,

 

I would tend to agree.  Your signature says someone is doing just that.  Who would that be, or, is there a thread covering it?  The downside is that fixing the module would result in DB changes.

 

Regards,

Chris

I dont' remember the user or the thread , but it was saying in that thread he is in the re-creating of the modules . if the module will not released , when i finish some pending module for our internal use , i will try to see what we can do for that , because we have the proxmox is our main software for vps solution .

the DB change is not a big probleme , as modules/plugins support upgrade proccess , so is not a probleme .

EDIT :

i have found the thread is here http://www.blesta.com/forums/index.php?/topic/2568-ability-to-override-the-system-information-tab-in-modules/#entry18423

the user is Mickey .

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...