Archived

This forum has been archived. Please start a new discussion on GitHub.

IceGrid 3.0 Admin migration

Unlike IcePack.Admin, IceGrid.Admin does not have addServer() and removeServer() methods. I'm trying to figure out what I need to do to migrate. Neither he 3.0 manual migration guide nor the article about IceGrid migration in the latest issue of Connections mentioned what to do here. I noticed there is an instantiateServer call in 3.0, but it is for "instantiating server templates" which we do not use and the args are vastly different from the old addServer(). In our old call to addServer() we are specifying a node name, serviceName, descriptor file name, and target list.

As far as removeServer() migration, there is a removeServers sequence in the NodeUpdateDescriptor used by the ApplicationUpdateDescriptor set by the IceGrid.Session.updateApplication() method. Is this what we should use now? The old removeServers() call did not require a node name, but just a server name. Is there some other way to remove a server just by name? I saw that icegridadmin still allows one to do this.

Perhaps I missed something in the docs so feel free to point me to existing info. Any help would be greatly appreciated.

Thanks,
Brian

Comments

  • benoit
    benoit Rennes, France
    Hi Brian,

    IceGrid doesn't support deploying servers without an application. You'll have to deploy one application per server or deploy one application where all your servers will be deployed.

    If you choose to deploy one application per server, then you can just use the addApplication()/removeApplication() methods of the IceGrid::Admin interface to add or remove the server with the application.

    If you choose to deploy an application where all your servers will be deployed, you'll have to update the application to add or remove a server. You can update the application with the IceGrid::Admin updateApplication() method. I recommend you to take a look at the implementation of the "server remove" admin command (in src/IceGrid/Parser.cpp), it should give you some hints on how to do this.

    Let me know if you need more information!

    Benoit.
  • Thanks for the response, Benoit. I think I figured out how to use updateApplication to remove a server. But can't comprehend how to do so for adding a server. Both ApplicationUpdateDescriptor and NodeUpdateDescriptor have Api for only removing or listing current servers, but not adding. I guess I need more help or a pointer to more example code.

    Thanks,
    Brian
  • benoit
    benoit Rennes, France
    Hi Brian,

    You should use the servers attribute of the NodeUpdateDescriptor structure. You can either add or update a server by adding the server descriptor to the servers sequence. Something along the lines of the following should make the job:
    NodeUpdateDescriptor nodeUpdate;
    nodeUpdate.name = <name of the node>;
    nodeUpdate.servers.push_back(<your new server descriptor>);
    
    ApplicationUpdateDescriptor update;
    update.name = <name of your application>;
    update.nodes.push_back(nodeUpdate);
    
    IceGrid::AdminPrx admin = /* proxy to IceGrid::Admin object */
    admin->updateApplication(update);
    

    Note that we would also be happy to provide you consulting services if you need more help with this ;) (contact sales@zeroc.com if you need more information on our consulting services).

    Benoit.