Community Forums

Discuss, share and get help from our community of friendly WHMCS users

Close
Login to Your Account
Page 1 of 7 123 ... LastLast
Results 1 to 15 of 103
  1. #1
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    95

    Exclamation Virtuozzo Module (that works) finally!

    Hey Guys!

    I am releasing to you all today on behalf of Digital Pacific (http://www.digitalpacific.com.au) a Virtuozzo module for WHMCS.

    Finally you will be able to provision containers, change passwords etc.

    Now; the code is a little bit rough around the edges, so there are a few things that might not always work 100%, but for the most part it should be OK.

    The code is not Zend'd or IonCube'd, so you will be able to see all of the source code. A proper module for WHMCS is something that we have all wanted for a long time, so if there is anything that can be improved upon, please send your patch to me tim <at> digitalpacific. com.au and I will include it, and throw your name in the author's list.

    Requirements:
    • JSON Module
    • SimpleXML


    I have only tested this on WHMCS 4.1.1 and 4.1.2.

    Download Link:
    http://opensource.digitalpacific.com.au/ (click on "download" under "libvz")

    Install Guide:
    1. Copy the contents of the "module" folder into the "module" folder where your WHMCS installation is.
    2. Run the Create Table statements that are in sql-queries.sql on your MySQL database where WHMCS is installed in.
    3. Utilities->Addon Modules->Virtuozzo and add all the names for the VZ servers that you have. This will allow all the VZ sample configs and OS's to be cached.
    4. In Setup->Products/Services, edit the product that is your VZ product.
    5. Module Settings -> Module Name=Virtuozzo, Package Name=<Sample Config Name as in VZ>
    6. Custom Fields -> Field Name=Environment ID, Field Type=Textbox, Select Options=Admin Only
    7. In Setup->Servers, edit/add your VZ server. Make sure that the hostname is correct (!) and the same as what you entered in the admin module for Virtuozzo.
    8. Server Details->Type=Virtuozzo, Username=root, Password=<shell password>


    That should work. It did for me

  2. #2
    Join Date
    Feb 2009
    Posts
    113

    Default

    I am interested to test it.

  3. #3
    Join Date
    Jan 2008
    Posts
    51

    Default

    Hi,
    It need more detailed documentation .
    I've tried it and didn't create a vps with success .
    I get an error that it couldn't find the os template ( I used the same values as on your site , I even bypass the custom fields and entered directly in the file the name of the template ).

    I think it needs more testing on new whmcs installations .

  4. #4
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    95

    Default Better explanations...

    Hi all,

    Sorry for the lack of explanation on my last post. I will attempt to explain things a bit better

    Step One: Copy the contents of the "module" folder into the "module" folder where your WHMCS installation is.

    Step Two: Run the Create Table statements that are in sql-queries.sql on your MySQL database where WHMCS is installed in.

    Step Three: Utilities->Addon Modules->Virtuozzo and add all the names for the VZ servers that you have. This will allow all the VZ sample configs and OS's to be cached.

    Step Four: In Setup->Products/Services, edit the product that is your VZ product.



    Please note: the package name should be *exactly* the same as what is shown in the Virtuozzo control panel (under Container Samples). The Environment ID *must* exist as a Custom Field.

    Step Five:
    Edit the Virtuozzo Server, ensure that the module type is Virtuozzo, and the user name and password is the root password for the box.


    Step Six:
    Ensure that there is a configurable option, with the option name "Operating System"


    Spaces in the name will be replaced with "-", [32 bit] will be replaced with -x86, [64 bit] will be replaced with -x86_64 (which is what they are called by VZ). Finally, everything will be turned lower case, and a dot put in front of the name, which is how EZ templates are named by the API. If something other then a EZ template is wanted, then something will need to be worked out to allow this to work.

    This means that the display name in the option Ubuntu 8.04 [32 bit] will be transformed into .ubuntu-8.04-x86

    If you have any other issues/questions, please reply to this post
    Last edited by timgws; 11-26-09 at 01:21 AM. Reason: Clarifying how the display name works

  5. #5
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    95

    Default

    New Version!
    A new version has been released, 0.11. It fixes the following issues:
    • No Error was returned when the wrong user name and/or password was entered into the server configuration.
    • No more hard coded IP; you can now set an IP pool for VZ to use, and containers will automatically be assigned one IP in that pool.

  6. #6
    Join Date
    Jan 2008
    Posts
    51

    Default

    Hello,

    I've added:
    error_reporting(E_ALL ^ E_NOTICE);
    ini_set("display_errors", 1);
    To display any errors and when I create I get:
    Fatal error: Uncaught exception 'VirtuozzoError' with message 'Could not find a configured Virtuozzo server to connect to.' in ....... lib_vz_api.php:57
    mysql> SELECT * FROM `mod_vz_servers` LIMIT 0 , 30;
    | 1 | vps1.domain.com | | | 0 | | |

    mysql> SELECT * FROM `tblservers` WHERE `hostname` LIKE 'vps1.domain.com' LIMIT 0 , 30 ;
    | 9 | vps1.domain.com | x.x.x.x | vps1.domain.com | 0.00 | | | | | | | | | | | 200 | virtuozzo | root | xx | | | 1 |

    Then if I replace in lib_vz_api.php line 49 `servername`='vps1.domain.com' it works till:

    I get: Error: Could not authenticate with server.
    If in virtuozzo.php line 99 I replace (!$vz->Login($params['serverusername'], $params['serverpassword'])) with the actual user and password it works till:

    I get: The configuration sample was not found on the server.Please check either the server login details, or check that the config name is exact.Also, check that the configuration name exists for the requested architecture.

    The Operating System is Centos 5 [64bit]
    On VZ i have centos-5-x86_64
    Double checked the Package name and it's the same.

    PS. the server name IP and password were changed in the mysql queries displayed here.

  7. #7
    Join Date
    Jan 2008
    Posts
    51

    Default

    ok , managed to create a vps with success , but with other modifications after those from above:
    Added in the mod_vz_servers table in column arch: x86_64 because it was empty .
    Changed in liv_vz_api.php line 292 the base_sample_id with the id I took from the table mod_vz_cache for that Product Name.

  8. #8
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    95

    Default

    Hi djaxel,

    Thanks for submitting your reports on issues. I am going to have a look and see how it all works out for me if I try and replicate the issue. I thought I removed all the architecture-dependent code. Obviously not.

    Also, from your original mod_vz_cache, what do your os_templates look like? For example, on mine it looks like this:
    ".debian-4.0-x86":"x86"
    (Notice the dot in front? Do you have this too?)

    The Operating System is Centos 5 [64bit], but there is no space between "64" and "bit"... I am going to work on the regex in a few days to make it a tad less restrictive, but you need that space. Otherwise it will look for centos-5-[64bit]-x86_64

    If $vz->Login is not working, then you really need to check your server config, it *should* work :/

    Thanks,
    Tim

  9. #9
    Join Date
    Jan 2008
    Posts
    51

    Default

    Hi,
    In mod_vz_cache I have:
    {".centos-5-x86_64":"x86_64",".fedora-core-10-x86_64":"x86_64",".ubuntu-9.04-x86_64":"x86_64",".debian-5.0-x86_64":"x86_64","redhat-as3-minimal-x86_64":"x86_64"}

    I used Centos 5 [64bit] because I think this is what I saw on your site , it doesn't matter for me if it has or not a space.

    Believe me , I've triple checked the server config , I know it should work but it doesn't connect till I modify the file itself .

  10. #10
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    95

    Default

    Quote Originally Posted by djaxel View Post
    I used Centos 5 [64bit] because I think this is what I saw on your site , it doesn't matter for me if it has or not a space.
    On our site, we have Centos 5 [64 bit]. It might not matter to you if there is a space between the number and the bit, but it does matter to the code. It will not work without a space at the moment.

    If you have .centos-5-x86_64 in your cache, you need to have CentOS 5 [64 bit] (or similar within the guidelines) as the name in your product selection.

    Unfortunately, there is no way to specify values for the names in your Configurable Options. What I mean by this is that you can set the display name, but not the name that is sent to the module - that is the same as the display name. Unfortunately this means that hacks need to be done in the code to get names that VZ will understand.

    Strange that it does not work for you though when you put it in the server config... it should work. Are you sure that there are no spaces etc in the password or username?

    Thanks,
    Tim

  11. #11
    Join Date
    Jan 2008
    Posts
    51

    Default

    Ok , found the problem.
    I've removed everything and reinstalled the module.
    The problem were that my vps package was a Dedicated/VPS Server type , so it didn't took the VZ server , I changed to Hosting type and it works.
    But I did had to add manually to mod_vz_servers in column arch: x86_64
    Now I get Configuration error: can't get specified '282c7d76-8e15-a54..........
    The line 292 from lib_vz_api.php needs to use the right base_sample_id from mod_vz_cache , at this point I see that is hard coded , not using the database.

  12. #12
    Join Date
    Jan 2008
    Posts
    51

    Default

    Quote Originally Posted by timgws View Post
    Unfortunately, there is no way to specify values for the names in your Configurable Options. What I mean by this is that you can set the display name, but not the name that is sent to the module - that is the same as the display name. Unfortunately this means that hacks need to be done in the code to get names that VZ will understand.
    I use Configurable Option Groups for other products with values like this:
    value_to_pass_to_module|value_to_be_displayed
    And it work fine , so it should work and for this module.
    Did you try it?

  13. #13
    Join Date
    Jan 2008
    Posts
    51

    Default

    I've used the value from table cache and json_decode it , it works ok , but I'm sure you can do a better job an interogate the database to decode the value.

    Create , change password and terminate functions work fine.
    The suspend function stops the vps instead of suspending it.
    The unsuspend function doesn't start/resume the vps ( but I'm receiving a success message in whmcs ).

    If you can please try to change the module that would create a vps with more than 1 IP adress ( you can use the ConfigOptions , like you used for the Package Name).

    Thanks .
    I appreciate the work you did with this module.

  14. #14
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    95

    Default

    Hey djaxel!

    Thank you very much about the hint with Configurable Option Groups with using the pipe. I did not know about that...

    The only issue I have with providing more then one IP at a time is how do we email the customer about the IP?

  15. #15
    Join Date
    Jan 2008
    Posts
    51

    Default

    Hi,
    I think the only solution is to use {$service_custom_fields.1} .
    We can make 5 ( or even more from case to case) custom fiels and asigne with the vallue when the vps is created.
    In the email we can use {$service_custom_fields.1}, etc to inform the client.

Page 1 of 7 123 ... LastLast

Similar Threads

  1. Replies: 0
    Last Post: 02-16-14, 09:09 AM
  2. OpenVZ / Virtuozzo Module
    By Helix Development in forum Commercial Modules and Addons
    Replies: 0
    Last Post: 01-03-12, 06:46 PM
  3. Virtuozzo WHMCS Module Released!
    By arisythila in forum Commercial Modules and Addons
    Replies: 80
    Last Post: 03-04-11, 04:49 PM
  4. Virtuozzo Module Testing
    By agruetz in forum Commercial Modules and Addons
    Replies: 25
    Last Post: 07-03-09, 03:53 AM
  5. New Virtuozzo WHMCS Automation Module
    By arisythila in forum Commercial Modules and Addons
    Replies: 21
    Last Post: 06-22-09, 09:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •