anchor.diff:  comet_loop({error, Reason}) ->
       {error, Reason};
   
  -comet_loop(#?STATE{counter = Counter, spaces_details = SpacesDetails} = State) ->
  +comet_loop(#?STATE{counter = Counter, spaces_details = SpacesDetails, workers = Workers} = State) ->
       NewState = try
           receive
  -            {create_space, Name, Token, Size} ->
  +            {create_space, StorageType, IsCeph, Name, Token, Size, Username, Key} ->
                   NextState =
                       try
                           RowId = <<"space_", (integer_to_binary(Counter + 1))/binary>>,
  +                        {ok, #token_issuer{client_type = <<"user">>, client_id = UserId}} =
  +                            gr_providers:get_token_issuer(provider, Token),
                           {ok, SpaceId} = gr_providers:create_space(provider,
                               [{<<"name">>, Name}, {<<"token">>, Token}, {<<"size">>, integer_to_binary(Size)}]),
                           {ok, SpaceDetails} = gr_providers:get_space_details(provider, SpaceId),
  +                        StorageId = get_storage_id(StorageType),
  +                        add_storage_space_mapping(Workers, SpaceId, StorageId),
  +                        maybe_add_ceph_user(Workers, IsCeph, UserId, Username, Key),
                           add_space_row(RowId, SpaceDetails),
                           onepanel_gui_utils:message(success, <<"Created Space's ID: <b>", SpaceId/binary, "</b>">>),
                           State#?STATE{counter = Counter + 1, spaces_details = [{RowId, SpaceDetails} | SpacesDetails]}
                       catch
                           _:Reason ->
  -                            ?error("Cannot create Space ~p associated with token ~p: ~p", [Name, Token, Reason]),
  +                            ?error_stacktrace("Cannot create Space ~p associated with token ~p: ~p", [Name, Token, Reason]),
                               onepanel_gui_utils:message(error, <<"Cannot create Space <b>", Name/binary, "</b> associated with token <b>", Token/binary, "</b>.<br>
                               Please try again later.">>),
                               State
  
positive.code: %% ====================================================================
  event(init) ->
      try
          {ok, SpaceIds} = gr_providers:get_spaces(provider),
          {SpacesDetails, Counter} = lists:foldl(fun(SpaceId, {SpacesDetailsAcc, Id}) ->
              {ok, SpaceDetails} = gr_providers:get_space_details(provider, SpaceId),
  
negative.code:     [SpaceId, RowId] = mochijson2:decode(Args),
      get(?COMET_PID) ! {revoke_space_support, RowId, SpaceId},
      gui_jq:show(<<"main_spinner">>).
  
  
  get_storage_id(<<"Ceph:", StorageId/binary>>) ->
      StorageId;
  get_storage_id(<<"DirectIO:", StorageId/binary>>) ->
      StorageId.
  
  add_storage_space_mapping(Workers, SpaceId, StorageId) ->
      SpaceStorage = onepanel_utils:dropwhile_failure(Workers, space_storage, new,
          [SpaceId, StorageId], ?RPC_TIMEOUT),
      {ok, _} = onepanel_utils:dropwhile_failure(Workers, space_storage, create,
          [SpaceStorage], ?RPC_TIMEOUT).
  
  maybe_add_ceph_user(_, false, _, _, _) ->
      ok;
  maybe_add_ceph_user(Workers, true, UserId, Username, Key) ->
      CephUser = onepanel_utils:dropwhile_failure(Workers, ceph_user, new,
          [UserId, Username, Key], ?RPC_TIMEOUT),
      {ok, _} = onepanel_utils:dropwhile_failure(Workers, ceph_user, save,
          [CephUser], ?RPC_TIMEOUT).