<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chris Psaltis</title>
    <description>The latest articles on DEV Community by Chris Psaltis (@cpsaltis).</description>
    <link>https://dev.to/cpsaltis</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F346158%2F09dfc91f-dddf-4ad4-a1bd-536ea6a7e78f.png</url>
      <title>DEV Community: Chris Psaltis</title>
      <link>https://dev.to/cpsaltis</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cpsaltis"/>
    <language>en</language>
    <item>
      <title>How to move files between Git repos and preserve history</title>
      <dc:creator>Chris Psaltis</dc:creator>
      <pubDate>Tue, 06 Oct 2020 07:48:54 +0000</pubDate>
      <link>https://dev.to/mistio/how-to-move-files-between-git-repos-and-preserve-history-27d0</link>
      <guid>https://dev.to/mistio/how-to-move-files-between-git-repos-and-preserve-history-27d0</guid>
      <description>&lt;p&gt;While working on a multitude of open source projects I faced an interesting Git puzzle. How can you move a file between Git repos?&lt;/p&gt;

&lt;p&gt;The easy solution is to just forget about Git history. If you like to preserve it, the situation is not very straightforward. Below we will explain the problem, your options and how to apply them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Let’s assume you work on forkX, which is a fork of repo projectX. In forkX you are collaborating with your colleagues. At the same time, projectX is also moving forward. ForkX includes files with a long history of commits that are not in projectX. You would like to push some of those files to projectX.&lt;/p&gt;

&lt;p&gt;Your current situation looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftlttadlom7g3l1csrjfu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftlttadlom7g3l1csrjfu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What do you do?&lt;/p&gt;

&lt;h2&gt;
  
  
  Option A: Delete history
&lt;/h2&gt;

&lt;p&gt;The easiest option is to push the files without preserving history.&lt;/p&gt;

&lt;p&gt;Based on the example in the graph above, add relevant remotes and fetch their current state:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git remote add projectX git@github.com:someOrg/projectX&lt;br&gt;
git remote add forkX git@github.com:myOrg/forkX&lt;br&gt;
git fetch --all&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now, move to a clean branch that is identical to projectX/master.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git checkout projectX/master&lt;br&gt;
git checkout -b cleanBranch&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then, add your new files:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git checkout forkX/newFeature -- file_1&lt;br&gt;
git add file_1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can repeat for more files and commit:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git commit -m “Add new feature”&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You are now ready to open a pull request. If you have the proper rights, you can just push with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push -u projectX&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Other than the “Add new feature” commit, the pushed files will have no history upstream. The person who pushed will appear as the sole contributor.&lt;/p&gt;

&lt;p&gt;This option is simple but will not work well when many people collaborate on the same files. You will end up deleting all contributors and every commit message along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option B: Preserve history
&lt;/h2&gt;

&lt;p&gt;In order to preserve history the situation is more complicated.&lt;/p&gt;

&lt;p&gt;Similarly to the previous option, add remotes, fetch their current state and move to a clean branch that is identical to projectX/master:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git remote add projectX git@github.com:someOrg/projectX&lt;br&gt;
git remote add forkX git@github.com:myOrg/forkX&lt;br&gt;
git fetch --all&lt;br&gt;
git checkout projectX/master&lt;br&gt;
git checkout -b cleanBranch&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git merge --no-ff --no-commit forkX/newFeature&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The command above will stop the merge with all the files staged and ready to be committed. For every file, besides the new ones, you do:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git reset filePath&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Be careful NOT to reset everything and then stage the new files again. When the new files are the only ones staged then you commit with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git commit -m "Add new feature"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Finally, delete the unstaged files with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git stash &amp;amp;&amp;amp; git stash drop&lt;br&gt;
git clean -f&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You are now ready to open a pull request. If you have the proper rights, you can just push with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push -u projectX&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;At &lt;a href="https://mist.io" rel="noopener noreferrer"&gt;Mist.io&lt;/a&gt; we rely on &lt;a href="https://libcloud.apache.org/" rel="noopener noreferrer"&gt;Apache Libcloud&lt;/a&gt; to interface with the APIs of many cloud providers. We maintain a fork of Libcloud to better control Mist’s dependencies and to develop new features before we push them upstream.&lt;/p&gt;

&lt;p&gt;Until recently, we were maintaining a driver for vSphere only in our fork. The driver was big, complicated and introduced new dependencies so we refrained from pushing it upstream. When we felt confident with the code we decided to open a pull request.&lt;/p&gt;

&lt;p&gt;The bulk of the new code was in a few files that didn’t exist upstream. However, the work on these files was done, over a long period of time, from several people in our team. For this reason, we wanted to preserve the history and we ended up using option B above.&lt;/p&gt;

&lt;p&gt;Here is an example of how the same pull request looks like when pushed &lt;a href="https://github.com/apache/libcloud/pull/1479" rel="noopener noreferrer"&gt;without history&lt;/a&gt; and &lt;a href="https://github.com/apache/libcloud/pull/1481" rel="noopener noreferrer"&gt;with history&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this post I went over how you can move files between Git repos. I showed two options; a simple one that deletes history and a complicated one that preserves it. I illustrated the two options with an example from Mist’s Libcloud fork and the upstream Libcloud repo.&lt;/p&gt;

&lt;p&gt;I would love to hear your thoughts in the comments!&lt;/p&gt;

</description>
      <category>git</category>
      <category>opensource</category>
      <category>devops</category>
    </item>
    <item>
      <title>6 issues with vSphere's RESTful API</title>
      <dc:creator>Chris Psaltis</dc:creator>
      <pubDate>Thu, 28 May 2020 15:31:44 +0000</pubDate>
      <link>https://dev.to/mistio/6-issues-with-vsphere-s-restful-api-24hj</link>
      <guid>https://dev.to/mistio/6-issues-with-vsphere-s-restful-api-24hj</guid>
      <description>&lt;p&gt;This post is meant as a warning for users who are thinking to leverage vSphere’s RESTful API. More importantly, we hope that someone on vSphere’s team will read this and take action.&lt;/p&gt;

&lt;p&gt;First, some brief history. vSphere's RESTful API, or &lt;a href="https://code.vmware.com/apis/991/vsphere-automation"&gt;Automation API&lt;/a&gt; as it is officially called, was introduced in v6.5. This initial version was lacking but in v6.7 it got better. Still, annoying issues persisted and going into v7.0 we were expecting to see some major improvements.&lt;/p&gt;

&lt;p&gt;In &lt;a href="https://blog.mist.io/post/618654171619540992/kubevirt-lxd-ldap-ad-mist-v43"&gt;Mist v4.3&lt;/a&gt; we extended our support to vSphere v7.0. We were also planning to port our integration from the old SOAP API to the RESTful one. Unfortunately, the transition was impossible due to several issues.&lt;/p&gt;

&lt;p&gt;In summary:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Calls for listings of resources return only a limited number of items and have no pagination.&lt;/li&gt;
&lt;li&gt;You can’t use VM templates that reside in folders.&lt;/li&gt;
&lt;li&gt;There is no way to resize disks.&lt;/li&gt;
&lt;li&gt;UIDs are returned only for VMs but not for other resources e.g. clusters, hosts, datastores etc.&lt;/li&gt;
&lt;li&gt;There is no information about hierarchical structures.&lt;/li&gt;
&lt;li&gt;You need to juggle through requests to get the IP of a VM.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Keep on reading for more details.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Pagination
&lt;/h2&gt;

&lt;p&gt;Automation API responses lack pagination and have a hard limit on the number of returned items. For example, &lt;em&gt;"GET /rest/vcenter/vm"&lt;/em&gt; returns up to 4,000 VMs (&lt;a href="https://code.vmware.com/apis/991/vsphere-automation/operations/com/vmware/vcenter/vm.list-operation.html"&gt;reference&lt;/a&gt;). In v6.7-U3 the limit used to be 1,000.&lt;/p&gt;

&lt;p&gt;What do you do if you have more than 4,000 VMs?&lt;/p&gt;

&lt;p&gt;You first need to get all hosts with &lt;code&gt;GET /rest/vcenter/host&lt;/code&gt; and then do a separate request for each one with &lt;code&gt;GET /rest/vcenter/vm?filter.hosts={{host-id}}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Keep in mind that &lt;code&gt;GET /rest/vcenter/host&lt;/code&gt; has a hard limit of 2,500 hosts (&lt;a href="https://code.vmware.com/apis/991/vsphere-automation/operations/com/vmware/vcenter/host.list-operation.html"&gt;reference&lt;/a&gt;). If you have more, you need an additional layer of nesting, e.g. get all datacenters, then loop for hosts and then loop for machines. Iterating like this, adds complexity and slows down code execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. VM templates in folders
&lt;/h2&gt;

&lt;p&gt;The Automation API supports only VM templates in Content Libraries (&lt;a href="https://code.vmware.com/apis/991/vsphere-automation/index.html#PKG_com.vmware.vcenter.vm_template"&gt;reference&lt;/a&gt;). It totally ignores templates in folders. No call returns them and there is no way to perform any action, e.g. move them to a Content Library.&lt;/p&gt;

&lt;p&gt;This is a surprising omission, especially if you consider that VM templates are commonly used to deploy new machines. The only thing you can do is move your templates to a Content Library before using the Automation API.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Disk resize
&lt;/h2&gt;

&lt;p&gt;There is no call to resize a disk. You can change the number of CPUs and the size of RAM, but not the disk. To add more disk space to a machine, your only option is to create a new disk and attach it. You are also unable to copy data between disks.&lt;/p&gt;

&lt;p&gt;Bottom line, if you need disk resizing stick to the SOAP API.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. UIDs and MoIDs
&lt;/h2&gt;

&lt;p&gt;Starting in v7.0, the Automation API returns UIDs of VMs. For other types of resources you have to settle with Managed Object Identifiers (MoIDs). The problem is that MoIDs are not unique across vCenters.&lt;/p&gt;

&lt;p&gt;This seems like a small fix, since the information is already there. We hope it will be available soon. Until then, be careful with IDs when you manage infrastructure on multiple vCenters.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Hierarchical structures
&lt;/h2&gt;

&lt;p&gt;Several objects in vSphere have a hierarchical structure. For example, datacenter -&amp;gt; cluster, cluster -&amp;gt; host, host -&amp;gt; VM, folder -&amp;gt; VM etc.&lt;/p&gt;

&lt;p&gt;Information about such structures is totally absent from API responses. To recreate it, you need to loop through all sorts of lists.&lt;/p&gt;

&lt;p&gt;Let’s assume you want to find the folder in which a VM resides:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get all folders with &lt;code&gt;GET /rest/vcenter/folder&lt;/code&gt;. Notice that there is a limit of 1,000 returned items and the response includes only folder name, MoID and type (&lt;a href="https://code.vmware.com/apis/991/vsphere-automation/operations/com/vmware/vcenter/folder.list-operation.html"&gt;reference&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;For each folder do &lt;code&gt;GET /rest/vcenter/vm?filter.folders={folder-id}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Then check if your VM is included in the response.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Such representations are useful very often and it’s hard to justify why they are not part of the API already.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. VM IPs
&lt;/h2&gt;

&lt;p&gt;If you want the get the IP of a machine you need to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;GET /rest/vcenter/vm/{vm-id}&lt;/code&gt; and get the NICs part. There you will find MAC addresses (&lt;a href="https://code.vmware.com/apis/991/vsphere-automation/operations/com/vmware/vcenter/vm.get-operation.html"&gt;reference&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GET /rest/appliance/networking/interfaces&lt;/code&gt;, for a list of all available interfaces. This is the only call that returns IP information (&lt;a href="https://code.vmware.com/apis/991/vsphere-automation/operations/com/vmware/appliance/networking.get-operation.html"&gt;reference&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Search through the list of interfaces for the relevant MAC address and get the IP you need.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One would expect the IP to be available from the first call above (1) or at least offer a simpler way to cross reference items between calls.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this post we went over the issues we had with vSphere’s Automation API. We also suggested some workarounds wherever possible.&lt;/p&gt;

&lt;p&gt;Having to build and maintain integrations with more than 20 infrastructure platform APIs, we are accustomed to idiosyncrasies and annoying issues. Unfortunately, in the case of the Automation API the issues were too many to deal with.&lt;/p&gt;

&lt;p&gt;Our hope is that future releases will solve these issues and the Automation API will become a first-class citizen in vSphere’s suite.&lt;/p&gt;

</description>
      <category>api</category>
      <category>vmware</category>
      <category>vsphere</category>
    </item>
    <item>
      <title>Comparing clouds: Billing for stopped machines</title>
      <dc:creator>Chris Psaltis</dc:creator>
      <pubDate>Thu, 05 Mar 2020 09:56:02 +0000</pubDate>
      <link>https://dev.to/mistio/comparing-clouds-billing-for-stopped-machines-lb1</link>
      <guid>https://dev.to/mistio/comparing-clouds-billing-for-stopped-machines-lb1</guid>
      <description>&lt;p&gt;Public clouds have grown considerably in size, complexity and sheer number of features. This makes it hard to answer even simple questions, especially when you are trying to compare clouds.&lt;/p&gt;

&lt;p&gt;At &lt;a href="https://mist.io"&gt;Mist.io&lt;/a&gt; we hear such questions daily so we decided to do something about it. This is the first in a series of posts that compare clouds on a number of practical issues.&lt;/p&gt;

&lt;p&gt;One of the questions we hear very often is some variation of the following:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does my cloud bill me for stopped machines, aka instances, linodes, droplets etc?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The reasoning behind this question is quite simple. If I stop a machine, it means I’m not using it so I assume my cloud will not bill me for it. After all, public clouds are all about elasticity. If this is the case, then I could save a lot of money by stopping machines when they are not needed.&lt;/p&gt;

&lt;p&gt;Unfortunately, things are not very straightforward.&lt;/p&gt;

&lt;p&gt;Let’s go over, in alphabetical order, what is happening.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
    &lt;th&gt;Service&lt;/th&gt;
    &lt;th&gt;Bills for stopped machines?&lt;/th&gt;
    &lt;th&gt;Notes&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Alibaba ECS&lt;/td&gt;
    &lt;td&gt;Yes (by default)&lt;/td&gt;
    &lt;td&gt;
      Instances are billed per second.&lt;br&gt;&lt;br&gt;

      You could avoid billing for stopped instances connected to a VPC and which don’t have local disks. User action is required for that.&lt;br&gt;&lt;br&gt;

      If you turn this feature on and stop an instance, you will be billed for any of the following that apply:&lt;br&gt;&lt;br&gt;

      a) attached block storage&lt;br&gt;
      b) associated elastic IPs&lt;br&gt;
      c) bandwidth&lt;br&gt;
      d) images&lt;br&gt;&lt;br&gt;

      For more details, check the official documentation for PAYG pricing &lt;a href="https://www.alibabacloud.com/help/doc-detail/40653.htm"&gt;here&lt;/a&gt; and specifically for stopped instances &lt;a href="https://www.alibabacloud.com/help/doc-detail/63353.htm?spm=a2c63.p38356.b99.17.418a7470ZwN0bN"&gt;here&lt;/a&gt;.
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Amazon EC2&lt;/td&gt;
    &lt;td&gt;No&lt;/td&gt;
    &lt;td&gt;
      Linux instances are billed per second with 60 seconds minimum. All others are billed per hour.&lt;br&gt;&lt;br&gt;

      When you stop an instance, you will be billed for any of the following that apply:&lt;br&gt;&lt;br&gt;

      a) attached block storage&lt;br&gt;
      b) associated elastic IPs&lt;br&gt;&lt;br&gt;

      For more details, check the official documentation &lt;a href="https://aws.amazon.com/ec2/pricing/on-demand/"&gt;here&lt;/a&gt; and “Billing and purchase options” in this &lt;a href="https://aws.amazon.com/ec2/faqs/"&gt;FAQ&lt;/a&gt;.
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Digital Ocean&lt;/td&gt;
    &lt;td&gt;Yes&lt;/td&gt;
    &lt;td&gt;
      Droplets are billed per hour.&lt;br&gt;&lt;br&gt;

      Check the relevant answers in their pricing &lt;a href="https://www.digitalocean.com/pricing/#FAQs"&gt;FAQ&lt;/a&gt;.
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Google Compute Engine&lt;/td&gt;
    &lt;td&gt;No&lt;/td&gt;
    &lt;td&gt;
      Instances are billed per second with 60 seconds minimum. Some premium images follow a different model.&lt;br&gt;&lt;br&gt;

      When you stop an instance, you will be billed for any of the following that apply:&lt;br&gt;&lt;br&gt;

      a) persistent storage attached&lt;br&gt;
      b) local SSDs&lt;br&gt;
      c) associated static IPs&lt;br&gt;&lt;br&gt;

      For more details, check the official documentation &lt;a href="https://cloud.google.com/compute/all-pricing"&gt;here&lt;/a&gt;.
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;IBM Cloud&lt;/td&gt;
    &lt;td&gt;No&lt;/td&gt;
    &lt;td&gt;
      Public Virtual Servers and billed per hour.&lt;br&gt;&lt;br&gt;

      IBM offers “Suspended Billing”. Servers after Nov 1st 2018 include suspended billing. Most servers created before this date don’t offer it.&lt;br&gt;&lt;br&gt;

      If suspended billing is available and you stop a server, then you will be charged for any of the following that apply:&lt;br&gt;&lt;br&gt;

      a) storage&lt;br&gt;
      b) secondary public IP address&lt;br&gt;&lt;br&gt;

      For more details, check the official documentation &lt;a href="https://cloud.ibm.com/docs/vsi?topic=virtual-servers-requirements"&gt;here&lt;/a&gt;.
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Linode&lt;/td&gt;
    &lt;td&gt;Yes&lt;/td&gt;
    &lt;td&gt;
      Linodes are billed per hour.&lt;br&gt;&lt;br&gt;

      Check the relevant answers in their pricing &lt;a href="https://www.linode.com/pricing/#row--faqs"&gt;FAQ&lt;/a&gt;.
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Microsoft Azure&lt;/td&gt;
    &lt;td&gt;Maybe&lt;/td&gt;
    &lt;td&gt;
      Virtual Machines are billed per second and for the full number of minutes the machine was running. The documentation specifically mentions that if a machine was running for 6min and 45sec you will be charged for 6min.&lt;br&gt;&lt;br&gt;

      If the machine status is “Stopped Deallocated”, you are not billed. If it is “Stopped” or “Stopped Allocated”, you are billed for allocated virtual cores but not for software licenses. Full details on virtual machine states are available &lt;a href="https://docs.microsoft.com/en-us/azure/virtual-machines/windows/states-lifecycle"&gt;here&lt;/a&gt;.&lt;br&gt;&lt;br&gt;

      In order to get to "Stopped Deallocated" state, you have to stop the machine from within Azure's management portal or over the API using a specific deallocation parameter. If you stop the machine from within the OS it will go into “Stop Allocated” state.&lt;br&gt;&lt;br&gt;

      If you manage to get to "Stopped Deallocated" state, please keep in mind that you are still billed for any of the following that apply:&lt;br&gt;&lt;br&gt;

      a) attached Premium (SSD based) disks&lt;br&gt;
      b) Attached Standard (HDD based) disks&lt;br&gt;
      c) In ARM deployment model, you are billed for static public IP address unless it is part of the first five in the region. Read more regarding IPs under the FAQ section at the bottom of this &lt;a href="https://azure.microsoft.com/en-us/pricing/details/ip-addresses/"&gt;page&lt;/a&gt;.&lt;br&gt;&lt;br&gt;

      For even more details, check the FAQ at the bottom of this &lt;a href="https://azure.microsoft.com/en-us/pricing/details/virtual-machines/linux/"&gt;page&lt;/a&gt;. The URL ends with /linux but you will also find the same FAQ under /windows…
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Vultr&lt;/td&gt;
    &lt;td&gt;Yes&lt;/td&gt;
    &lt;td&gt;
      Vultr cloud instances are billed per hour.&lt;br&gt;&lt;br&gt;

      Check the relevant answers in their pricing &lt;a href="https://www.vultr.com/resources/faq/"&gt;FAQ&lt;/a&gt;.
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For easier reference, you can also view the table above in &lt;a href="https://docs.google.com/document/d/1E3l3nM8x6_LasUFvSLXYYtEySZsj46qYL9lx0jpY-NU/edit"&gt;Google Docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The comparison includes only services that offer cloud machines. There are also a number of services that offer dedicated hosts and/or bare metals. We didn’t include such services above because they are inherently different and, as expected, they charge you regardless of machine state.&lt;/p&gt;

&lt;p&gt;Also, please keep in mind that the comparison refers to pay-as-you-go (PAYG) pricing. Alibaba, Amazon, Google, IBM and Microsoft offer reserved and spot pricing as well. In the case of reserved pricing, you will be billed even if you don’t use your reserved capacity. In spot, stopping a machine will usually release it and return it to the pool. Billing stops at that point, but you can no longer use the machine. This happens in Amazon, Google and Azure. In Alibaba and IBM, stopping a spot will not release it, but you will continue to incur charges until they either claim it back or you release it yourself.&lt;/p&gt;

&lt;p&gt;If things were not complicated enough, you also need to take special usage discounts into account. Such discounts are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Alibaba subscriptions&lt;/li&gt;
&lt;li&gt; Amazon saving plans&lt;/li&gt;
&lt;li&gt; Google committed-use and sustained-use discount&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the case of &lt;a href="https://www.alibabacloud.com/help/doc-detail/56220.htm?spm=a2c63.p38356.b99.15.25cc166bYXiesi"&gt;Alibaba subscriptions&lt;/a&gt;, things are rather simple. When you buy a subscription you pay a discounted price upfront for the entire billing cycle. Changing the status of the machine won't save you anything.&lt;/p&gt;

&lt;p&gt;With &lt;a href="https://aws.amazon.com/savingsplans/"&gt;Amazon saving plans&lt;/a&gt;, things are simple too. You commit to certain usage over 1yr or 3yr term and get a discount. If you use it, you’re good. If you don’t use it, you still pay for it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cloud.google.com/compute/docs/instances/signing-up-committed-use-discounts"&gt;Google’s committed-use discounts&lt;/a&gt; are very similar to Amazon saving plans.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cloud.google.com/compute/docs/sustained-use-discounts"&gt;Google’s sustained-use discounts&lt;/a&gt; are more complicated. First of all, Google follows an approach which they call &lt;a href="https://cloud.google.com/compute/resource-based-pricing"&gt;resource-based pricing&lt;/a&gt;. In this model, the base price of a machine is tied to the underlying resources it is using (vCPUs and memory). If during your billing cycle you continue to run the same total amount of resources, then you gradually earn a discount that’s increasing over time. This is the sustained-use discount. The discount is irrelevant to the actual machines you run, it ties only into the total amount of resources used. This discount doesn’t increase linearly over time. To understand it better we strongly recommend reading the documentation pages linked above.&lt;/p&gt;

&lt;p&gt;Having said all of the above, let’s restate the initial question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Will I save money if I stop my cloud machines when they are not in use?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The answer depends on a number of factors. To get to the bottom of this you need to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Check if your service will charge you for stopped machines and how.&lt;/li&gt;
&lt;li&gt; Check your reservations and long term commitments.&lt;/li&gt;
&lt;li&gt; Don’t take spot into account.&lt;/li&gt;
&lt;li&gt; If you are using Google Compute Engine, do the math for the sustained-use discount.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All these might sound disheartening, but you could potentially save a lot of money. Just to get a sense of ROI, one of our customers was recently able to reduce a 5-digit monthly bill for dev infrastructure by 50%. They did it by automatically tagging machines upon provisioning and then setting a schedule to stop them during off business hours.&lt;/p&gt;

&lt;p&gt;Bottomline, the effort is well justified. Do your research and good luck!&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>comparison</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
