code: public Alarm createAlarm(ManagedEntity me, AlarmSpec as) throws InvalidName, DuplicateName, RuntimeFault, RemoteException {
          if (me == null) {
              throw new IllegalArgumentException("entity must not be null.");
          }
          ManagedObjectReference mor = getVimService().createAlarm(getMOR(), me.getMOR(), as);
          return new Alarm(getServerConnection(), mor);
      }
docs: Create an alarm against the given managed entity using the alarm
  specification
  
  @param me
  The {@link ManagedEntity} to alarm against.
  @param as
  The {@link AlarmSpec} used to generate the alarm.
  @return The new {@link Alarm} created
  @throws InvalidName
  if the alarm name exceeds the max length or is empty.
  @throws DuplicateName
  if an alarm with the same name already exists.
  @throws RuntimeFault
  if any unhandled runtime fault occurs
  @throws RemoteException