Archive

Posts Tagged ‘virtual machine’

How to Differentiate Folders in vSphere

January 28th, 2011 4 comments

As we know Folder is a container object in vSphere. It’s used to hold other managed objects in a similar way as directory holding files in an OS. There is an interesting question asking in VI Java API forum on how to tell whether a folder is vmFolder or hostFolder. BTW, you don’t see these two folders displayed in vSphere Client.

The questioner guessed correctly that you can find out by a folder’s childType property. Here is the documentation in API reference on the possible values of the childType property:

How to Delete Virtual Machine With vSphere API?

January 18th, 2011 3 comments

This question was asked at VI Java API forum recently and has been answered by the community.

There should be a “Destroy_Task()”-Method for each Managed Object, so also Virtual Machines…. Cheers, Joerg

As  Jörg Lew has correctly pointed out the solution, I would like to elaborate a bit more here.

If you are using VI Java API, the method name is destroy_Task(). The code is as simple as:

Cloud Architecture Patterns: Cloud Broker

January 3rd, 2011 No comments

Intent

Provide a single point of contact and management for multiple cloud service providers and maximize the benefits of leveraging multiple external clouds.

Category

Structural

Motivation

When you are buying and selling stocks or other securities, you hire a broker to execute the trade on your behalf. One reason for that is convenience. You don’t need to take care of the details of placing orders and working with multiple stock exchanges, and whatever else is required to trade securities.

How about working with multiple cloud service providers? For sure, you can go online to any cloud provider as long as you have your credit card ready. But is the service provider the best fit for your requirements? Do you have a backup plan if you are not satisfied with your service provider? Can you easily switch among your service providers to minimize cost or maximize flexibility? If you are not sure, you may then need something like a cloud broker.

Solution

Cloud Architecture Patterns: Service VM

December 20th, 2010 No comments

Intent

Provide an easy way to provision new infrastructure and application services for a computing cloud

Category

Behavioral

Problem

To run a large-scale computing infrastructure, you will need many different types of services, including compute, storage, and networking, among others. After virtualization has successfully detached compute from the physical hardware, it’s very easy to provision and scale compute. But compute requires storage and networking which are lagging behind. To maximize the benefits of virtualization and cloud computing, it’s natural to push the storage and networking in the same direction.

Looking beyond the infrastructure to consider applications, we need various types of services such as database, directory, messaging, and more. I’ve covered the App VM pattern that allows using IaaS for PaaS in a previous blog. While you can pack some of these services into an application VM, the problem is that it scales well but does not follow the aspectual centralization pattern.

Solution

Cloud Architecture Patterns: App VM

November 29th, 2010 No comments

Intent

Provide packaged software stack as Platform-as-a-Service (PaaS) platform for running applications

Category

Behavioral

As Known As

PaaS VM

Motivation

We all know the three different types of cloud services from Infrastructure-as-a-Service (IaaS), PaaS, to Software-as-a-Service (SaaS). If you want to leverage PaaS, you have to choose one of the PaaS service providers like Google or Microsoft. Leveraging an external PaaS has its own benefits.

What if you want to keep your applications running in-house but still enjoy the benefits of PaaS? Today you don’t have much choice. Google, for example, does not sell its App Engine as a product that you can install and run on premise. You have to run it on the Google cloud.

Solution

What You Can Learn from IBM Research on Designing Private Cloud

November 16th, 2010 No comments

IBM Researcher Kyung Ryu presented a private cloud RC2 at LISA 2010 conference. As a typical IBM project, the presentation has 20+ co-authors. The following is based on my notes taken from the session, therefore may contain my misunderstandings.

Having an internal cloud is not a big deal these days. You can find several products from the market. What is truly unique and challenging for RC2 is that it supports very different virtualization platforms from X86 based hypervisors on X-series servers, to IBM PowerVM on P-series, to the mainframe based native virtualization on Z-series. Therefore RC2 is really a hybrid private cloud.

The talk focused on system architecture with several diagrams. I cannot reproduce these diagrams but would list the key components of the system:

Cloud Architecture Patterns: Façade VM

November 15th, 2010 No comments

Intent

Provide a single point of contact for a large-scale system consisting of many virtual machines so that they are viewed as one giant VM from outside

Category

Structural

As Known As

Giant VM

Motivation

When a system becomes big, you need multiple VMs to support the workload. For ease of use reasons, external users don’t want to manage multiple connections to each of the virtual machines. Who wants to remember a list of IP or DNS names for a service? Also, you just cannot expect your users to pick up the least-busy VMs for balanced workloads across your cluster of VMs. And to scale your application when your overall workload increases, you want a seamless way adding new capacities without notifying others.

Finally, if you offer a public service, you don’t want to allocate a public IP address for each of your VMs. These days, public IPs are scarce resources and may cost you money.

Cloud Architecture Patterns: VM Pool

November 1st, 2010 4 comments

Intent

Provide a mechanism to fast provision virtual machines (VMs) and manage their lifecycles by maintaining a pool of virtual machines.

Category

Creational

Motivation

Virtual machines can be expensive to create. It takes several minutes to create a new virtual machine. Technologies like linked clone and storage offloading can help speed up the process, but it still takes time. And these alternative approaches, in some use cases, do not help when you need instant provisioning.

Solution

It’s generally a good practice to pool resources that are expensive to create. In programming, you pool threads and check them out on demand. When it’s done, you check them in back to the pool. This is what most Web Servers do for high performance.

You can leverage the same idea for VM provisioning. You create new virtual machines and put them into a pool. When there is a new request, you just check out one virtual machine from the pool. The following diagram shows how it works.

“Last Inch” of Cloud Computing

September 20th, 2010 2 comments

The “last mile” or “last kilometer” is a term in the networking industry describing “the close to end connectivity from a communication service provider to a customer”. Although your infrastructure like backbones is very powerful, your end user experience could suffer if your last mile is not there yet.

For cloud computing, we’ve talked a lot about the data centers, backend servers. What about the end users? Your cloud data center could be very powerful too, but does it mean your users will fully leverage that power? Not necessarily. It depends on how you deliver the service to them.

Because cloud service is delivered with traditional network, the traditional network “last mile” issue is there as well. You surely need a good, if not better, connection to the network.

Beyond the connectivity, you will need good interfaces for your users to interact with the cloud. Let me go over the “last inch” options here.

How to Avoid Virtual Machine Sprawl in Cloud Age?

September 13th, 2010 2 comments

Technology can be a lot like fashion, with quickly shifting trends. Once we embraced big iron but after the mainframe age the industry went into the client/server age where we soon found too many servers to manage. So we consolidated them, not back to mainframe age, but onto hypervisors. With one physical server, you can run multiple virtual machines.

Server consolidation solved a big problem and resulted in big cost savings. From management’s point of view, however, it does not actually reduce the number of servers to manage in your enterprise. To some extent, it worsens the problem!  In some circumstances it’s so easy and inexpensive to create a new virtual machine that you end up with many more servers than you really want or can effectively manage. This problem not only exists in private clouds, but also in the public cloud.

According to VMware CEO Paul Maritz in his keynote at VMworld 2010, the number of virtual machines exceeded physical machines in 2009, and will reach 10 million by the end of this year. This is definitely great news for the virtualization software industry but also a challenge moving forward.

So how should you try to solve the problem of virtual machine sprawl or even better, prevent it from happening? I discuss some solutions one by one here.

Really Easy Ways to Capture VM Screenshot

September 8th, 2010 7 comments

Since vSphere 2.5, there is a feature allowing you to capture screen shot of a running virtual machine. It’s not well publicized but you can find a short description with screenshotSupported (boolean) in the HostCapability data object. Thanks to Nikita for bringing this up in the comment of the vSphere Java API 2.1 GA post.

Indicates whether the screenshot retrival over https is supported for this host’s virtual machines. If true, a screenshot can be retrieved at the HTTPS relative path /screen?id=<managed object ID of virtual machine or snapshot>. If any of the optional parameters ‘top’, ‘left’, ‘bottom’, and ‘right’ is specified, the returned image will be cropped from the rectangle with upper left corner (left, top) and bottom right corner (right – 1, bottom – 1). These values default to the top, left, bottom and right edges of the image. The client must use an authenticated session with privilege VirtualMachine.Interact.ConsoleInteract on the requested virtual machine or, in the case of a snapshot, the virtual machine associated with that snapshot.

The managed object ID of virtual machine is the value of ManagedObjectReference, which can be easily found using MOB.

Once you have it, you can issue a URL as follows in any browser and get the screen shot in PNG format.

UUID vs. vSphere

August 12th, 2010 4 comments

UUID stands for universally unique identifier (UUID). It’s a 128-bit value. vSphere uses it as IDs for many different types of entities like HostSystem, VirtualMachine, Datastore, etc.

The UUID surfaces to the vSphere API as well. You can find many methods use UUID as parameter or return result. The most commonly used one is the SearchIndex.findByUuid() which find you a virtual machine or a host based on its UUID, either instance or BIOS UUID. The format used for UUID is as follows:

52dc2e26-dbc4-7d05-5fed-019d234379d9

Since 4.0, DistributedVirtualSwitchManager managed object is added and it has a method called queryDvsByUuid(). As reported by VI Java API community, the standard format doesn’t work. The accepted format is like this:

How to Promote a Virtual Machine’s Disks?

August 10th, 2010 No comments

What does a promotion mean for a virtual machine’s disks? When you get a promotion, you may have more salary, a better title, bigger office space, etc. For sure a virtual disk cannot earn salary and doesn’t care about title, but it can occupy bigger space in datastore.

In my previous blog, I discussed how to create linked virtual machines using vSphere API. These linked virtual machines share a common disk as base, therefore the total disk consumption is significantly reduced. When a virtual disk is promoted, it gets its own “office” other than sharing it with others.

The vSphere API to promote virtual disks is promoteDisks_Task defined with VirtualMachine type. It has a tricky parameter called “unlink” (type: boolean) . According to the API reference:

1. If the unlink parameter is true, any disk backing which is shared shared by multiple virtual machines is copied so that this virtual machine has its own unshared version. Copied files always end up in the virtual machine’s home directory.

2. Any disk backing which is not shared between multiple virtual machines and is not associated with a snapshot is consolidated with its child backing.

Now when should you use true or false? “If the unlink parameter is true, the net effect of this operation is improved read performance, at the cost of disk space. If the unlink parameter is false the net effect is improved read performance at the cost of inhibiting future sharing.”

Here is the sample code that illustrates the usage of the API:

System Provisioning in Cloud Computing: From Theory to Tooling (part 2)

July 1st, 2010 No comments

Application Provisioning

With the right system configuration in place, it’s time to install the applications. So why not use the same tools we used for the OS and middleware? Do we need yet another set of tools?”

It depends. You can use the same set of tools for middleware to install some applications. The middleware appears like an application to the OS as well. The difference is whether your application is stable enough and whether you need to customize per node. The tools like Puppet can be good for stable applications that can be deployed the same way across all nodes. If your application is still a work in progress and you need flexibility to tweak it, you need more specialized application provisioning tools.

The big technical difference between application and middleware provisioning tools is that application tools push the application to the nodes and remotely change anything as needed. The process is procedural.

The middleware provisioning tools normally have agents on the nodes to pull the software based on the prescribed configuration files. The process is declarative.

Beyond the “push” and “pull” difference, the application provisioning tools can also manage the lifecycles of applications (sometimes called services) distributed on different nodes with a single line of command or code. Given the nature of remote command dispatching framework, the application provisioning tool can do almost anything. If there has to be a limitation, it’s your imagination.

So if you develop applications by yourself, you most likely need application provisioning tools.

Let’s see what tools are there.

System Provisioning in Cloud Computing: From Theory to Tooling (part 1)

June 30th, 2010 No comments

Cloud computing is an evolutionary technology because it doesn’t change the computing stack at all. It simply distributes the stacks between the service providers and the users. In some sense, it is not as impactful as virtualization technology which introduced a new hypervisor layer in the computing stack and fundamentally changed people’s perception about computing with virtual machines.

But if you look closely at the latest IaaS clouds, they do leverage virtualization as a way to effectively and efficiently deploy systems. Inside one virtual machine, the computing stacks remain the same as before: from OS to middleware to application.

Keep in mind that the application is the end while the OS and middleware are the means. Customers care about applications more than the underlying infrastructure. As long as the infrastructure can support the applications, whatever the infrastructure might be is fine technically. Then the question would shift to the economic side: whatever is the most cost effective wins in infrastructure. That’s why Linux gains more shares in the cloud than in traditional IT shops.

To get to the end, you have to take a mean. In the IaaS cloud, you have to install the underlying OS and middleware before you can run your application. For the PaaS cloud, you can get away from that by focusing on application provisioning.

OS Provisioning

Remember, the software stack inside a virtual machine doesn’t change. It needs OS, middleware and application installed and configured before the application can work.

Virtual Appliance: Is It a Virtual Machine or an Application?

April 19th, 2010 6 comments

With the growth of virtualization, a new term “virtual appliance” has been coined for a special type of virtual machines that are used like applications. What does it really mean?

First, a virtual appliance is still a virtual machine. When seen in vSphere Client, the virtual appliance does not look much different from other typical virtual machines. Secondly, the functionality of the virtual machine is limited to that of an application. More often than not, the virtual machine is installed with one application. Because of this, the underlying OS is stripped down only to the minimum required to support that application. This type of OS is also called Just Enough OS (JEOS). All the existence of the JEOS is to support the application in the virtual appliance.

Now, is it a VM or an application? It could be either, depending how you look at it. For ESX/vCenter, a virtual appliance is a virtual machine. You can manage it just like any other virtual machine. For application users, it’s an application, a special one that is different from a normal application.

Virtual Machine, IP Address, and MAC Address: Frequently Confused Concepts

April 13th, 2010 22 comments

Having answered many questions about IP addresses of virtual machines at different occasions, I still see more are coming. I think it’s time to write a blog about it. Hopefully people would search the Internet before raising the question.

First of all, there is a big confusion on the relationship of IP addresses and virtual machines. Many people tend to associate IP addresses with virtual machines, and want to retrieve/change the IP address of a virtual machine.

In fact, a virtual machine is very much like its physical counterpart. It does not have an IP address by itself. In other words, an IP address is NOT an intrinsic attribute of a machine, either virtual or physical. It might have one or more only after an OS is installed. In most cases, it does have one or more IP addresses, which gives the impression that every machine has an IP address.

A virtual machine does have intrinsic attributes such as MAC addresses if NIC cards are configured. Unlike its physical counterpart, a virtual machine’s MAC address can be re-configured. Some software vendors rely on MAC addresses to lock down their licensed software on particular machines. This mechanism can be, therefore, compromised in virtual environments.