public String getMacAddressForVm(final String vmName) throws VMWareException {
        ServiceInstance si = null;

        try {
            si = this.getServerInstance();
            Folder rootFolder = si.getRootFolder();
            VirtualMachine vm = (VirtualMachine) new InventoryNavigator(rootFolder).searchManagedEntity("VirtualMachine", vmName);

            VirtualDevice[] devices = vm.getConfig().getHardware().getDevice();
            VirtualEthernetCard vec = null;
            for (VirtualDevice dev : devices) {
                if (dev instanceof VirtualEthernetCard) {
                    vec = (VirtualEthernetCard) dev;
                    break;
                }
            }

            return vec.getMacAddress();
        } catch (PlatformConfigFault f) {
            throw new VMWareException(f);
        } catch (RemoteException exc) {
            throw new VMWareException(exc);
        } catch (Exception exc) {
            throw new VMWareException(exc);
        }
    }