Showing posts with label VM. Show all posts
Showing posts with label VM. Show all posts

Cloud Native Revolution


Have you heard all the buzz around cloud native applications? So, what do they really mean? During 2000s, lot of IT companies like Google, eBay and Tweeter required efficient means of building and deploying their applications in order to provide global services. Along the way, these companies realized that they need a stable architecture without rewriting their architecture over and over again. So this made the entrance to cloud native applications. Cloud native refers to applications that are installed in cloud based virtual machines. Cloud native applications use an elastic infrastructure. This underlying infrastructure should support the applications to scale up and down at a rapid rate, with the ability to offer millions of nodes or instances at the same time. As I think, adopting cloud native applications helps an organization to transform their information technology into a force for true agility. 

Virtual Machines

During the early stages of cloud computing, the primary mover was the virtual machine. Many other hardware virtualization methods sprang.

  • One of the most important open source project called Xen project had been started with the expectation to power some of the largest clouds in production today. Amazon web services, Aliyun, Rackspace Public Cloud and many other hosting services use Xen Project software. It is also integrated with multiple cloud orchestration projects like OpenStack. 
  • KVM (Kernel-based Virtual Machine) was introduced as a virtualization infrastructure for the Linux kernel that turns into a hypervisor. 
  • Microsoft Hyper-V on Windows was introduced to provide software infrastructure and basic management tools to create and manage a virtualized server computing environment.

Multi tenancy

Multi tenancy is a type of architecture in which a single instance of a software application serves multiple customers, where each customer is called a tenant. A tenant can customize some parts of the application, but not the application's code. Multi tenancy can be identified as a model where each computer has accounts and users can log into their accounts and share disk space and CPU resources. Multi tenant computing takes advantage of resource sharing, virtualization and remote access. 

These technologies that were originally purposely built for a small set of selected companies like Google, eBay and Facebook are now been brought to the world through open source projects so that everyone other than the handful of companies with large budgets and large teams can also benefit from them. 
And that's where this really leads to a revolution: a cloud native revolution! 


Containerization



The concept of "containerization" is one of the most important areas of innovation for modern computing. This has a huge impact on cloud computing and on how enterprises develop their cloud applications. 

Over the last decade, applications were monolithic. They were built on a single stack such as .NET, Java etc. and they had been deployed to a single server. Any how, they lived long. Then came load balancers where the workload was distributed across multiple computing resources. Still they were monolithic.

After a huge revolution, today applications are constantly developed where security patches and updates are often done. New versions are being developed often. They are built from loosely coupled components and they are deployed to a multitude of servers. This is where containers comes into play.

In brief container is a,
                           Lightweight Linux environment
                           Deployable application
                           Introspectable, runnable artifact

So what does a container provide that a virtual machine does not?

  • Simple deployment : A container simplifies the deployment process of the application no matter where you are deploying it. It packages the application as a single addressable, registry stored, deployable component. 
  • Rapid availability : The package can boot faster compared to a modern virtual machine. 
  • Leverage micro services : Containers allow developers and operators to subdivide the compute resources further. 
  • Better performance 
  • Faster provisioning of resources : Since the developer has in their laptop plenty of compute power to run multiple containers, development is fast and easy. 
  • Quicker availability of new application instances : Release administration is easy as pushing a new container is a single command. 
  • Easy and cheap testing : With a container, we can do thousands of simple tests at the same cost. 
The significance of containers also lies in the fact that, no matter where we run it, it looks the same everywhere we run it. Therefor using containers, we can install the application in a production data center and we can make it to work exactly the same in the development environment. 

According to my point of view, the most important feature that containerization ensures is a portable, consistent format for running applications on diverse hosts. Considered as a whole, containerization allows workloads to easily flow to where they are cheapest and fastest to run. 

Containers are the idea of running multiple applications on a single host. Instead of virtualizing a server to create multiple operating systems, containers offer a more lightweight solution by virtualizing the operating system, allowing multiple workloads to run on single host. 

Recently containers became popularized by a containerization mechanism called Docker.

What is Vagrant, how to install it





Vagrant is a tool that can be used to create different development environments. This can be used to create a production environment which is exactly similar to the development environment. On the other hand, vagrant is a solution to the ‘IT WORKS IN MY MACHINE, WHY NOT YOURS’ problem. 

There was an era where you try to install and configure all prerequisites within your local machine for developing applications. At that time, a web application was merely a PHP script backed by a MySQL database. But now the complexity of the applications has increased and the tradition of developing applications has also changed. For example, modern web applications have a lot more moving parts accompanied by different technologies. At present, there are different dynamic languages like JavaScript, Python, Ruby while there are different database choices like MySQL, PostgreSQL, Redis, Riak, Cassandra etc. In addition to different languages and databases, there are multiple web servers, application servers and backend services as well. Apache, Nginx, Unicorn, Thin, RabbitMQ, Solr are some of them. So keeping up everything properly configured and installed locally in a machine is very challenging. 

Vagrant solves this problem by creating complete development environments sandboxed in a virtual machine. Ultimate objective is to lower the development environment setup time and make the development and production process efficient. Since vagrant creates a virtual environment within your machine, users can run different operating systems simultaneously. But this has its pros and cons as well. Let’s discuss its positive aspects first.

With vagrant, we can create a virtual machine for us based on any operating system we require. Moreover we can modify the physical properties of this virtual machine like the number of CPUs and RAM too. We can establish network interfaces to access that virtual machine from our own computer, from another device on the same network or from another virtual machine. We can set up shared folders so that we can edit files in our machine and also let those modifications to mirror over to other machines. Depending on different software that needs to install and configure, rising time of vagrant can vary. After that, everything is up to vagrant because vagrant handles the entire life cycle of the machine afterwards. 

By now, I assume that you understand that vagrant creates a development environment similar to the production environment. Is that all that vagrant can do? No, vagrant can do more. It can SSH into the machine. This would allow remote login and other remote network services to operate securely over an unsecured network. You can boot the machine as well as halt the machine at any time, moreover you can resume the machine too. Not only that, you can destroy the machine completely by deleting its virtual hard drive and metadata. 

A testing environment is required for testing various releases and new tools in your software development work. Vagrant supports that too. After all the greatest benefit is that you can package the machine state so that you can distribute it to the other developers when working as a team. So why not try vagrant? 


Installing Vagrant and VirtualBox

Here I will show you how to install Vagrant if you are running Linux OS. By default, Vagrant uses VirtualBox for managing virtualization. VirtualBox is a cross-platform virtualization application. It will display you the information and status of different virtual machines that runs in your machine. 




Installing Vagrant: 

$ sudo apt-get install vagrant
Otherwise you can download vagrant for your OS from here.



Installing Virtualbox:

$ sudo apt-get install virtualbox
Otherwise you can download the VirtualBox binaries for your OS from here.



If you want to make vagrant up, you should navigate to the directory that contains the Vagrantfile and execute the following command. This will copy a VM image to create a new virtual machine, apply configuration to it, boot it.

$ vagrant up
You may get an output similar to this through your VirtualBox interface.



If you want to shut down or power off the VM use the following command.

$ vagrant halt
If you want to shut down the virtual machine and delete its stored image, execute the following command. Note that this will delete all the files of that particular VM from your machine.

$ vagrant destroy




References

1) https://docs.vagrantup.com/v2/why-vagrant/
2) https://www.vagrantup.com/
3) https://www.virtualbox.org/wiki/Downloads