Search code examples
web-servicescloud-foundrypaas

Cloud Foundry, how it works?


As I understood, it does not create a Virtual Machine for every new service, but it runs all the services in a Warden container into the 'DEA' Virtual Machine, somewhere in a IaaS provider (like Openstack, AWS..)

What I didn't understood is: does the DEA VM 'reserve' X resources at any time (so even if there are no services deployed)?? In this case i would pay for the maximum resources always.

Another question: what if the DEA is 'full' and I need to scale it too? would be possible? To create on the fly another DEA VM and move some services there? How can I find some documentation about that? I find the CloudFoundry website don't have much information


Solution

  • As I understood, it does not create a Virtual Machine for every new service, but it runs all the services in a Warden container into the 'DEA' Virtual Machine, somewhere in a IaaS provider (like Openstack, AWS..)

    If you replace the word "service" with "app", this statement is correct. It's important to make this distinction because Cloud Foundry also has the concept of services, which are different than apps.

    To summarize, Cloud Foundry runs one or more DEA VMs. These are provisioned on your IaaS, typically using Bosh. Your applications pushed to Cloud Foundry will run inside the DEA VMs. On the DEA, the applications will run within a container, which isolates the applications.

    What I didn't understood is: does the DEA VM 'reserve' X resources at any time (so even if there are no services deployed)?? In this case i would pay for the maximum resources always.

    The DEA VMs are created when you deploy Cloud Foundry. They are assigned their resource limits at this time (RAM, VCPUS, etc...). Without deploying any apps, there's not much running on the DEA VMs though so most of those resources are unused.

    As you or your users deploy apps, the DEA will create new containers to run your apps. Containers are created very, very quickly so they don't need to be preallocated. Also, the containers themselves do not really consume resources, they just set limits for the applications running in them.

    It's the apps themselves that consume the bulk of resources like disk space, memory and CPU. That only happens when apps are running though.

    Another question: what if the DEA is 'full' ?

    Cloud Foundry will only deploy apps on the DEA if there's room. When one fills up, it stops taking new apps. Other DEAs, if you have them, will need to take the new apps or your users will get an error saying there's not enough room for the new app.

    and I need to scale it too would be possible? To create on the fly another DEA VM and move some services there?

    If you're deploying with Bosh the answer is yes. You can tell Bosh how many DEAs you want deployed and it will make it so.

    How can I find some documentation about that? I find the CloudFoundry website don't have much information

    I'd suggest starting with the Bosh docs. Those are here. Then look at the "Running Cloud Foundry" column on the docs page here.

    For OpenStack, you can check out these instructions and if you have any questions the vcap-dev mailing list is a good place to ask them.