                   @ensureDomainSettings {account, vm, type, nickname, groupSlug}
                   @createDomains account, hostnameAliases, hostnameAliases[0]
 
-  @ensureDomainSettings = ({account, vm, type, nickname, groupSlug})->
+  @ensureDomainSettings = ({account, vm, type, nickname, groupSlug, stack})->
     domain = 'kd.io'
     if type in ['user', 'expensed']
       requiredDomains = ["#{nickname}.#{groupSlug}.#{domain}"]

            return console.error err  if err or not account
            # New account found
            webHome       = username
            vm.update {$set: {hostnameAlias:newHostNameAlias, webHome}},(err)=>

              return console.error err  if err
              # VM hostnameAlias updated

              nameFactory = (require 'koding-counter')
                db          : JVM.getClient()
                offset      : 0
                counterName : "koding~#{username}~"
              nameFactory.next (err, uid)=>
                return console.error err  if err
                # Counter created

                hostnameAliases = JVM.createAliases {
                  nickname:username
                  type:'user', uid, groupSlug:'koding'
                }
                JVM.createDomains account, hostnameAliases, hostnameAliases[0]

                console.log """Migration completed for
                               #{hostnameAlias} to #{newHostNameAlias}"""

    JGroup.on 'GroupDestroyed', (group)->
      group.fetchVms (err, vms)->

      numCPUs           :
        type            : Number
        default         : KONFIG.defaultVMConfigs.freeVM.cpu ? 1
      stack             : ObjectId

  suspend: (callback)->
    @update { $set: { hostKite: '(banned)' } }, (err)=>
