Using virtual resources
Virtual resources in Puppet might seem complicated and confusing, but in fact they're very simple. They're exactly like regular resources, but they don't actually take effect until they're realized (in the sense of "made real"). Whereas a regular resource can only be declared once per node (so two classes can't declare the same resource, for example), a virtual resource can be realized as many times as you like.
This comes in handy when you need to move applications and services around between machines. If two applications that use the same resource end up sharing a machine, they would cause a conflict unless you make the resource virtual.
To clarify this, let's look at a typical situation where virtual resources might come in useful.
You are responsible for two popular web applications, FaceSquare and Flipr. Both are web apps running on Apache, so they both require the Apache package to be installed. The definition for FaceSquare might look something like the following...