我们很高兴宣布我们最新的API :linode.clone()。 这个API 调用允许你轻松地将现有的Linode克隆到你选择的数据中心的一个新实例中。 它将克隆源Linode上的所有配置文件和磁盘镜像。
为了保护Linode基础设施,该方法对来自同一源Linode的五个并发克隆有一个限制。 如果你试图在达到并发限制时执行另一个克隆,API ,将返回一个 "验证 "错误。 如果你想执行一个大规模的克隆过程,原始的Linode可以被克隆五次,然后一旦这些克隆完成,被克隆的Linode又可以各自并发地克隆五次,以此类推。 这使你能够快速地将你的基础设施从一个Linode扩展到数百个。
我们希望你喜欢这个新的API ,并希望它对你未来在Linode云的部署有帮助。
-蒂姆
评论 (10)
Wow, great!
We’ve been looking for something like this for a while
Are there any pre-requisites for this API Call?
Is the Linode need to be shutdown or will be shutdown during the clone process?
How long would it take to clone? Is it the same thing as if its done from the console?
AWESOME! Been waiting for this for so long, at least now we can script our scaling activities!
Can we get one for checking the amount of bandwidth/transfer used for the current month next? (To compare against the existing call for finding the quota.)
@Dash
> Is the Linode need to be shutdown or will be shutdown during the clone process?
https://www.linode.com/api/linode/linode.clone —
“It is recommended that the source Linode be powered down during the clone.”
The source Linode doesn’t have to be powered down, but it is recommended to ensure that a consistent copy of your data is cloned.
> How long would it take to clone? Is it the same thing as if its done from the console?
1-2 minutes per GB of data within the same datacenter of the source Linode (the Linode you’re cloning from), or 5-10 minutes per GB of data if migrating to a different datacenter.
I assume that you should not .clone() a Linode that has static networking set up, since the static confi will render the new node unreachable… or am I missing something?
Xof:
You could still clone the Linode, but you’d need to use LISH to log in to the new Linode and adjust the networking configuration to the new IP address(es).
Tony Yarusso:
There isn’t currently a way to see how much transfer a particular Linode has used that I can see, but account.info() shows transfer pool amount and usage:
https://www.linode.com/api/utility/account.info
How would you suggest auto scaling in an HA environment where you want to clone and configure network addresses all in one go?
The limitation of 5 clones per source linode seems very arbitrary – you’re just offloading additional work to the side of the script doing the cloning. You might think we’re going to keep track of the clone count on our own, but the truth is we’re just going to iterate over existing linodes until the clone() call returns without an error.
What difference could it possibly make on your end whether we clone a single linode 10 times versus cloning an initial linode 5 times, and then cloning the first clone 5 additional times? There should be no difference in your ability to “protect Linode infrastructure”..?
Xof brought up a good question regarding the static networking setup causing new node unreachable. May I know what is the best solution for that in Linode? Doug’s suggestion to login using LISH and change it manually doesn’t make sense to me, as it defeats the purpose of autoscaling.