docs-content icon indicating copy to clipboard operation
docs-content copied to clipboard

👩‍💻 Documentation Request: Improve the cost of your instances

Open thib-info opened this issue 1 year ago • 10 comments

Summary

When you are using Scaleway as your main cloud provider solution, you obviously host more than only production machines. Such as pre-production or others for a different usage that don't need a 100% availability. The goal of that documentation page would be to:

  1. Propose a viable solution plan to optimize the turn-on/off from the machines who don't request a 7/7d-24/24h availability
  2. Explain technically how you can do that by using the Terraform solution.

Why is it needed?

  1. A Scaleway account with instance already created
  2. Rights to modify your scaleway account in order to access Terraform solution (API keys)
  3. Terraform installed on your local machine.

Want to write this documentation yourself?

Yes

Related PR(s)

No response

(Optional) Scaleway Organization ID

5050540446

Email address

[email protected]

thib-info avatar Dec 02 '23 14:12 thib-info

Hi @thib-info

Did you write any draft? I am also interested in this automation. If you have not started yet, I can collaborate or write on myself.

aecceyhan avatar Dec 31 '23 04:12 aecceyhan

Hello back @aecceyhan

I didn't have the time yet to start the documentation, but It's something I would like to start, yes. I don't know if you prefer to read a draft I'll initiate or collaborate with me on this documentation.

Keep me update about this

thib-info avatar Jan 02 '24 13:01 thib-info

@thib-info hi

If you already start something lets look the draft first.

aecceyhan avatar Jan 02 '24 13:01 aecceyhan

Then let me 2 weeks to start writing this. I'll do a POC at the same time, so I can verify the method we're going to introduce.

thib-info avatar Jan 02 '24 16:01 thib-info

Apologies, I think I misunderstood what you said earlier. So, if I understand correctly now, there is no draft?

Regarding this document (https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/instance_server#examples), I'm not certain if it's possible to stop instances using the Terraform 'apply' command.

However, if it is feasible to do so manually (but in a generic way) with the Terraform 'apply' command, we could potentially schedule it using the new jobs feature.

Additionally, scheduling SCW CLI commands might be a better approach, though I'm not completely sure; it's just a thought.

aecceyhan avatar Jan 03 '24 03:01 aecceyhan

Hey @thib-info! Glad to hear that you wanna contribute to Scaleway docs. Let us know when you're ready to a PR!

ofranc avatar Feb 08 '24 13:02 ofranc

Hi back @aecceyhan, I was kind of busy this last month and had to wait for this documentation.

After looking deeper on it and used Terraform during this last month, I don't think handling the state is the best solution indeed cause it means that we have to modify automatically terraform file content and apply the modification.

As you told, we could use the SCW CLI commands, but I was thinking of using the API instead. It might be simpler to use a python image inside a pipeline instead of building a custom one, including the SCW CLI.

I was thinking of doing that. Using a small Python script to get all the instances with the needed tag and turn them on/off inside a pipeline. We could use a scheduled pipeline inside GitLab and don't know yet if it's also possible on GitHub (I guess it is).

What do you think of that ?

thib-info avatar Feb 21 '24 08:02 thib-info

Hello back @ofranc. Can you check the last message I've written 3 weeks ago? I've been able to develop that process to handle the computation of our instances on Scaleway in order to develop our business and more respect our environmental impact. Does this tutorial documentation interest you or not ? Otherwise, I will invest time to furnish a well written documentation. :+1:

thib-info avatar Mar 12 '24 16:03 thib-info

Hello @thib-info, let me get back to you before the end of the week. Thanks!

ofranc avatar Mar 13 '24 16:03 ofranc

Re @thib-info, it's a yes. You can go ahead and open a PR! Thanks!

ofranc avatar Mar 18 '24 12:03 ofranc

Hello @thib-info, If you don't mind we will close this issue. Feel free to open a new one when the content is ready.

ofranc avatar Jul 25 '24 15:07 ofranc