docs: def create(gandi, datacenter, memory, cores, ip_version, bandwidth, login,
             password, hostname, image, run, background, sshkey, size, vlan, ip,
             script, script_args, ssh, gen_password):
      """Create a new virtual machine.
  
      you can specify a configuration entry named 'sshkey' containing
      path to your sshkey file
  
      $ gandi config set [-g] sshkey ~/.ssh/id_rsa.pub
  
      or getting the sshkey "my_key" from your gandi ssh keyring
  
      $ gandi config set [-g] sshkey my_key
  
      to know which disk image label (or id) to use as image
  
      $ gandi vm images
  
      """
      try:
          gandi.datacenter.is_opened(datacenter, 'iaas')
      except DatacenterLimited as exc:
          if exc.date:
              gandi.echo('/!\ Datacenter %s will be closed on %s, '
                         'please consider using another datacenter.' %
                         (datacenter, exc.date))
  
      if gandi.image.is_deprecated(image, datacenter):
          gandi.echo('/!\ Image %s is deprecated and will soon be unavailable.'
                     % image)
  
      pwd = None
      if gen_password:
          pwd = mkpassword()
  
      if password or (not pwd and not sshkey):
          pwd = click.prompt('password', hide_input=True,
                             confirmation_prompt=True)
  
      if ip and not vlan:
          gandi.echo("--ip can't be used without --vlan.")
          return
  
      if not vlan and not ip_version:
          ip_version = 6
  
      if not ip_version:
          gandi.echo("* Private only ip vm (can't enable emergency web console "
                     'access).')
  
      # Display a short summary for creation
      if login:
          user_summary = 'root and %s users' % login
          password_summary = 'Users root and %s' % login
      else:
          user_summary = 'root user'
          password_summary = 'User root'
  
      gandi.echo('* %s will be created.' % user_summary)
      if sshkey:
          gandi.echo('* SSH key authorization will be used.')
      if pwd and gen_password:
          gandi.echo('* %s setup with password %s' %
                     (password_summary, pwd))
      if not pwd:
          gandi.echo('* No password supplied for vm (required to enable '
                     'emergency web console access).')
      result = gandi.iaas.create(datacenter, memory, cores, ip_version,
                                 bandwidth, login, pwd, hostname,
                                 image, run,
                                 background,
                                 sshkey, size, vlan, ip, script, script_args,
                                 ssh)
      if background:
          gandi.echo('* IAAS backend is now creating your VM and its '
                     'associated resources in the background.')
  
      return result