1. An apparatus in a system comprising a wireless sensor network (WSN), a service cloud, and a device, the apparatus comprising: a virtual sensor configured to receive data from a physical sensor in the WSN; a virtual sensor controller configured to receive a request for the data from the service cloud or the device, and spawn a virtual machine (VM) based on the request; and the VM configured to transmit the data to the service cloud or the device.