Jump to content

Dedicated Server Module


EidolonHost

Recommended Posts

This thread was created to discuss how the module works, code-wise. You may submit code to be merged into DSM with proper credits to you in a CREDITS file.

This module was based on SolusVM module from Blesta's devs. As such, there are lots of SolusVM functionality still in this script. I'm working on removing them and cleaning up the module. I'm still wrapping my head around the validation rules that're presenting a major stumbling block.

I'd be happy to have people submit code via Github and help with testing of the module via a development Blesta copy that they have.

GITHUB LINK: DSM, also known as Dedicated Server Module

THIS IS NOT SUITABLE FOR PRODUCTION USE YET

What this module can do:

1. Create a Dedicated/Colo Server Group

2. Create servers for either group

3. Edit servers for either group

4. Delete servers for either group

5. Assign servers to customers.

What this module CANNOT do:

1. OS Reloads

2. IP Management for Dedicated/Colos

What needs work and may not work reliably 100%

1. Adding client's package, either via log in as client by admin, or via admin backend.

2. Editing client's package, either via log in as client by admin, or via admin backend.

What DOES work and works reliably 100%

1. Installing module

2. Uninstalling module

3. Editing module details

4. Adding Server as a ackage

5. Editing Server as a package

6. Adding Servers via the Manage section of the module

7. Editing Servers via the Manage section of the module

Screenshots galore!

http://imgur.com/gallery/l63Wq

Documentation

Since this module makes use of Configurable Options, please see the Configurable Options for further details on how to add HDD, RAM, CPU, etc to your packages when configuring this module.

Comments and Thoughts on Module

I'm sure there will be questions about when this module will be ready for production use.

I do not know when the module will be ready for production use, but I'm doing my best to get it into production ready state. With that said...

I'm not a professional module developer. Thusly, if you spot issues and the like in the module, please either post about it here or open a Github issue and I will get right to work on fixing the issue or ask for help in fixing the issue.

Also, my response times will be somewhat slow for some time, until July at the latest, as I don't have reliable internet access right now. So keep that in mind!

Right now, I'm working on figuring out how the validation rules work. And for the love of god, I need to figure out how to safely remove the nodeid crap. It's making it difficult to reliably edit and add servers. I also have not yet figured out how to ensure the password is hashed and encrypted, as seen in screenshot #5 :U

Is it even a good idea to have it set that way? Maybe use an SSH key for Linux servers instead? I have no idea what the equivalent is for Windows Servers and stuff, so... suggestions on this would be great. Also, as far as the Type option for the servers go, I was thinking of moving it to the Add Server screen so that the admin can set it as Windows or Linux when adding the server to be assigned to a customer.

Thoughts on that?

Link to comment
Share on other sites

nice work , i don't want to minimize your efforts but this is my real opinion about this module ;

 

this module with that functions is less usable , and is less strong than the universal module .

 

BUT to convert this module to a unique and powerful module is to add to it the CONDITIONAL LOGIC for components .

HOW ? add fields to package that let users select thier wanted :

 - OS (select option)

 - HDD 1

 - HDD 2

 - HDD 3

 - HDD 4

 - RAM (2,4,6,8,12,16,24,32, ...ect)

 - Ethernet Port ( 100Mp/1Gp)

 - RAID (0,1,5,10 ...) depend of selected HDD .

 - Control Panel (Cpanel , Plesk , DA, , Webmin , Inerwork...)

 - IPs (4,8,16,32,64,128,256 ...)

 

We can help you in this, just we need to colobarate in this work all together , my BOSS (is a user here , AKA Naja7host) has a portfolio for this to do it , i have see a mockup logic for this in his office already .

 

Finally , this is a first step to the real Dedicated Server Module .

Link to comment
Share on other sites

Great work, I really appreciate your effort!

 

As activa also specified, this is a great starting point but it kinda needs a coupe of options:

  • HDDs: here you can make a selector from 1 to...infinity? Or maybe let the user insert the no. of HDDs? I'm mentioning that because I had cases in which the clients asked for...mmm...10-12 HDDs. Sure, you can make a selector from 1 to maybe 48?
  • RAID: here things get kinda complicated. RAID should be available only in "combinations" with the currently selected HDDs. You can't make a RAID10 with 3 HDDs, so that option should be unavailable for 3 HDDs. Still, if this is a big chore, than I think it's best just to specify all RAID configurations and the client will select its own option;
  • RAM: same as HDDs, most users have max 128GB but hey...1TB of RAM is not so hard to find nowadays;
  • Ethernet port: in my case the provider offers me 300mbps per server. Not 100mbps, not 1gbps, but 300mbps. So maybe you should make a selector form 10mbps to 1gbps?
  • Control Panel: maybe you can let each user insert it's own control panels? Personally I sell only cPanel, Plesk, Webmin and SolusVM, but I know a lot of guys who also sell more "exotic" stuff;
  • IPs: this is kinda mandatory. I don't think you should start coding an IPAM (obviously it would be *really* handy!) but at least give the option specify what /class are you selling to the client, and then let the sales/deployment guy insert the IPs manually. Right now we're doing this with WHMCS (manually inserting IPs), it's not the best option but it was *very, very* important and handy, as most clients just say "we have a problem with the server with IP 123.456"; so having a fast way to search for IPs (even with no IPAM) is a really useful thing.

I have mediocre HTML / CSS skills (I'm the sales guy) but if I can help you with anything please let me know.

 

Again, I really appreciate your effort and dedication!

Link to comment
Share on other sites

nice work , i don't want to minimize your efforts but this is my real opinion about this module ;

 

this module with that functions is less usable , and is less strong than the universal module .

 

BUT to convert this module to a unique and powerful module is to add to it the CONDITIONAL LOGIC for components .

HOW ? add fields to package that let users select thier wanted :

 - OS (select option)

 - HDD 1

 - HDD 2

 - HDD 3

 - HDD 4

 - RAM (2,4,6,8,12,16,24,32, ...ect)

 - Ethernet Port ( 100Mp/1Gp)

 - RAID (0,1,5,10 ...) depend of selected HDD .

 - Control Panel (Cpanel , Plesk , DA, , Webmin , Inerwork...)

 - IPs (4,8,16,32,64,128,256 ...)

 

We can help you in this, just we need to colobarate in this work all together , my BOSS (is a user here , AKA Naja7host) has a portfolio for this to do it , i have see a mockup logic for this in his office already .

 

Finally , this is a first step to the real Dedicated Server Module .

This is already possible, at least to a degree, by using Config Options. Conditional Logic won't be available in the core until much later, I think, based on Paul's word.

Preliminary task for config option conditionals CORE-1708. No ETA.

If you want to work on this module, I'm perfectly happy to do so. I submit all of my code to Github for version control and to let others have an easy view of the code.

Link to comment
Share on other sites

Great work, I really appreciate your effort!

 

As activa also specified, this is a great starting point but it kinda needs a coupe of options:

  • HDDs: here you can make a selector from 1 to...infinity? Or maybe let the user insert the no. of HDDs? I'm mentioning that because I had cases in which the clients asked for...mmm...10-12 HDDs. Sure, you can make a selector from 1 to maybe 48?
  • RAID: here things get kinda complicated. RAID should be available only in "combinations" with the currently selected HDDs. You can't make a RAID10 with 3 HDDs, so that option should be unavailable for 3 HDDs. Still, if this is a big chore, than I think it's best just to specify all RAID configurations and the client will select its own option;
  • RAM: same as HDDs, most users have max 128GB but hey...1TB of RAM is not so hard to find nowadays;
  • Ethernet port: in my case the provider offers me 300mbps per server. Not 100mbps, not 1gbps, but 300mbps. So maybe you should make a selector form 10mbps to 1gbps?
  • Control Panel: maybe you can let each user insert it's own control panels? Personally I sell only cPanel, Plesk, Webmin and SolusVM, but I know a lot of guys who also sell more "exotic" stuff;
  • IPs: this is kinda mandatory. I don't think you should start coding an IPAM (obviously it would be *really* handy!) but at least give the option specify what /class are you selling to the client, and then let the sales/deployment guy insert the IPs manually. Right now we're doing this with WHMCS (manually inserting IPs), it's not the best option but it was *very, very* important and handy, as most clients just say "we have a problem with the server with IP 123.456"; so having a fast way to search for IPs (even with no IPAM) is a really useful thing.
I have mediocre HTML / CSS skills (I'm the sales guy) but if I can help you with anything please let me know.

 

Again, I really appreciate your effort and dedication!

My thanks.

Again, this is possible with Config Options. Since this is based on the SolusVM module, you should be able to add the configurable options with the specifics you desire.

However, conditional logic won't be available until much later, as per Paul's word.

Also, will be releasing version 0.0.2 fixing the Add and Edit Package issue.

Remaining issue at present is successfully adding it to a client's account. I'll post the issue I'm having with it in the next post shortly.

Link to comment
Share on other sites

Version 0.0.2 has been pushed to Github!.

Changelog:

  • 1. Corrected Add/Edit Package issues. You are now able to add Dedicated Servers as a package in the Package section. 
  • 2. Removed most of node, plan and template code. Some of the code still remains, as I am not sure what the equivalent or replacement code would be. I'd need to have someone more experienced look at the code. Preferably the Blesta devs, if at all possible.
Issues
  • 1. Currently unable to add new service for dedicated servers to client's account via admin or log in as client functions. Results in either a white page or an error. Currently attempting to reproduce.
  • 2. Still trying to figure out how to safely remove the remains of the code. Particularly the API code. It's not needed here for now. Heh.
Edit: Ah right, I remember now.

The issue is as follows:

 

Oh noes!

Undefined property: stdClass::$user_id on line 226 in /home/admin/public_html/testdomain.com/billing/components/modules/dsm/dsm.php
There's another issue here. If I try removing $user_id, this results in another Oh Noes! error. If I fix that one as well, it results in a white page. Edited by Keiro
Link to comment
Share on other sites

Great Work @keiro :)

Thanks! Still a bit to go before I'll call it done. I didn't think I'd get the issues worked out fairly quickly as I expected to... maybe I'm finally starting to really understand Blesta and, to a degree, CodeIgniter code.

Funnily enough, working on CodeIgniter code actually helped me to understand Blesta more easily. But I'm afraid I'm still a newbie when it comes to actually working with PHP and modules like this.

Link to comment
Share on other sites

So last night, while I was in the shower (of course...) I was thinking about the module for some reason and had a thought,

 

"That username and root field in Add Server screen... dude, you know that's the wrong place for it. Put Datacenter, Location, Rack as the options for the Add Server screen in its place!"

 

And thus, an eureka moment was born. So, I will be adding those options into DSM shortly and pushing it to Github. Shouldn't be overly difficult to add, it's simply a text replacement and slight modification of the language file to account for the change.

 

The Rack, row field will be added to the service side... at least, when I figure out how to do that for the admin-side because those're basically admin-only functions. But the Datacenter and Location field will be added to the Add Server screen. I'll update the screenshots after I do that to ensure people don't get confused.

 

Edit:

 

Dammit, I completely and utterly broke it. I'll have to rebuild it again from the last working copy I have. Thank goodness for version control.

Link to comment
Share on other sites

So last night, while I was in the shower (of course...) I was thinking about the module for some reason and had a thought,

 

"That username and root field in Add Server screen... dude, you know that's the wrong place for it. Put Datacenter, Location, Rack as the options for the Add Server screen in its place!"

 

And thus, an eureka moment was born. So, I will be adding those options into DSM shortly and pushing it to Github. Shouldn't be overly difficult to add, it's simply a text replacement and slight modification of the language file to account for the change.

 

The Rack, row field will be added to the service side... at least, when I figure out how to do that for the admin-side because those're basically admin-only functions. But the Datacenter and Location field will be added to the Add Server screen. I'll update the screenshots after I do that to ensure people don't get confused.

 

Edit:

 

Dammit, I completely and utterly broke it. I'll have to rebuild it again from the last working copy I have. Thank goodness for version control.

 

Hello Keiro .

 

i will also help just need some time , now what you can do is something to design how the module should be ..

 

field that shouldbe in Package

fields that should be in admin side

fields that should be in client side

 

which field are mandatory and wich one is obligatory .

 

type of fields (text , selectbox , checkbox, radio ...ect )

 

and let the other work for me ;)

Link to comment
Share on other sites

Hello Keiro .

 

i will also help just need some time , now what you can do is something to design how the module should be ..

 

field that shouldbe in Package

fields that should be in admin side

fields that should be in client side

 

which field are mandatory and wich one is obligatory .

 

type of fields (text , selectbox , checkbox, radio ...ect )

 

and let the other work for me ;)

 

I'm about to push a new copy of the script with the stuff that a dedicated server provider would need.

 

At least, I think I've got it all... but if I didn't, it'll be trivial to add the stuff admin-side. Client-side, I'm still figuring out the logic.

 

But I can tell you what I would personally need in a module.

 

Admin-side, there would be the following fields I would need:

 

1. Server ID # (also known as device id in this new copy)

2. Server IP # (also known as device ip)

3. Location

4. Datacenter

 

Clients should be able to set hostname, username other than root/Administrator if they don't want to use root/Administrator for Linux/Windows based systems, in addition to choosing what type of server it needs to be.

 

As for fields that should be in a Package... that's usually dependent on the individual using the module.

 

I think I've got the best set-up that'd work as a module right now, but... there is that slight bit of uncertainty, as if I might be missing something.

 

today i get time to see the module structure and code, i found it the same as the solusvm module , and there are just some change . this way we can't work with a solid code, iprefer begin from the scratch .

i will search my files for the old module and try to revive it again .

 

Yeah, as said in the original post, it's based on the SolusVM module. Eventually we'll probably migrate away from the SolusVM code to our own module code.

 

For now, the SolusVM module gets us very close to what a dedicated server module should be. It gives me an opportunity to learn how the module should work and how I might want to write one from scratch.

 

Give me about 5 minutes and I'll upload a new updated copy of the module to Github.

Link to comment
Share on other sites

  • 1 month later...

Sorry for the double posting but: I'm considering whether or not to implement a web-ssh client. Obviously, if I can't figure out how to implement a webssh client, I'll probably set up a tab so it allows you to connect to your own shellinabox instance if you ever want to do out-of-band SSH management. Or... something. :P

Link to comment
Share on other sites

Dedicated server in US

http://www.lucn.us

 

That's not really appropriate in here, bro. I'll let it slide but others may not.

 

Just so you know, this module is meant for managing assignments of dedicated servers. It does not do anything in terms of actual management... as in OS reloads, IP management, all that sorta thing.

Link to comment
Share on other sites

  • 2 months later...

Alright, finally starting to get back into developing the module.

 

It will take me a bit to start cranking out a fix for all the current issues that I've notated in the OP and made sure the module's properly set up. I need to refamiliarize myself with the module again since it has been a while since I last worked on it.

 

Of course, as always, comments, code-fixes and suggestions are always highly welcomed.

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...