     {vmName, status} = options
     fetchVmByHostname account, vmName, (err, vm) ->
       return callback err if err
-      return callback new KodingError "VM Not FOUND" unless vm
 
       [{ id: groupId }] = vm.groups
       JGroup = require './group'


      selector =
        hostnameAlias : hostnameAlias
        users         : { $elemMatch: id: user.getId(), owner: yes }

      JVM.one selector, callback

  @addVm = ({ account, target, user, sudo, groups, groupSlug
             type, planCode, planOwner, webHome, uid }, callback)->


    fetchVmByHostname delegate, hostnameAlias, (err, vm) ->
      return callback err  if err
      [{ id: groupId }] = vm.groups
      JGroup = require './group'
      JGroup.one { _id: groupId }, (err, group)->
