Updated on 2025-08-26 GMT+08:00

Creating a Component Based on a VM

ServiceStage supports a maximum of 15,000 components in the same project.

This section describes how to create a component, save a component draft, and deploy a component based on a VM.

When you create a component but do not complete the parameter settings, you can save the draft to prevent the parameters from being lost due to factors such as page closing. During component creation, you can click Save as Draft to prevent component parameter settings from being lost.

Prerequisites

  • An application has been created because components can only be added to applications. For details, see Creating an Application.
  • An environment supported by VM-based deployment has been created and resources have been managed because components need to be deployed in an environment.
  • Create a component based on a software package:
    • Upload the software package to the SWR repository. For details, see Uploading a Software Package.

      If PKIToken is disabled, the SWR repository is not supported.

    • Upload the software package to the OBS bucket. For details, see Streaming Upload (PUT).
    • If the package type is software package and you need to use JFrog (example) as the software package repository, you can download the package from the HTTP/HTTPS custom file address. Upload the software package to the corresponding custom file address in advance.

    If the software package fails to be uploaded, see What If a Software Package Fails to Be Uploaded?

Video Tutorial

Creating and Deploying a Component Based on a VM

  1. Log in to ServiceStage.
  2. Select a component creation mode.

    • To create a component from scratch, go to 3.
    • To create a component based on a component draft, go to 4.

  3. To create a component from scratch, perform the following operations:

    1. Use any of the following methods to go to the Create Component page.
      • Choose Component Management > Create Component > Create Now.
      • On the Application Management page, select the application for which you want to create a component, and click More > Create Now in the Operation column.
      • On the Application Management page, click the application for which you want to create a component. On the displayed Overview page, click Create Component > Create Now.
    2. Go to 5.

  4. To create a component based on a component draft, perform the following operations:

    1. Use either of the following methods to go to the Create Component page.
      • On the Application Management page, click the application where the component draft is located. The Component Management page is displayed. In the component list, click the target component whose Status is Draft.
      • On the Component Management page, click the target component whose Status is Draft.
    2. Go to 5.

  5. In the Basic Information area, configure the component by referring to the following table. Parameters marked with an asterisk (*) are mandatory.

    Parameter

    Description

    *Component Name

    Name of a component, which cannot be changed after the component is created and deployed.

    Enter 2 to 64 characters. Start with a letter and end with a letter or digit. Only use letters, digits, underscores (_), and hyphens (-).

    • Components with the same name in different applications can be deployed in the same environment.
    • Components with the same name in the same application can be deployed in different environments.

    *Component Version

    Component version number, which can be automatically generated or customized.

    • Automatically-generated: Click Generate. By default, the version number is the time when you click Generate. The format is yyyy.mmdd.hhmms, where s is the ones place of the second in the timestamp. For example, if the timestamp is 2022.0803.104321, the version number is 2022.0803.10431.
    • Customized: Enter a value in the format of A.B.C or A.B.C.D. A, B, C, and D are natural numbers. For example, 1.0.0 or 1.0.0.0.

    *Application

    Application to which the component belongs.

    *Environment

    Select VM or VM + Kubernetes.

    For details, see Environment Overview.

    *Deployment Mode

    Select VM.

    This parameter is mandatory when Environment is set to VM + Kubernetes. For details, see Component Deployment Modes.

    Labels

    ServiceStage allows you to add labels of the key-value pair type to manage and select components. Each component can have a maximum of 20 labels.

    If your organization has configured tag policies for ServiceStage, add tags to trackers based on the policies. If a tag does not comply with the tag policies, environment creation may fail. Contact your administrator to learn more about tag policies.

    1. Click Add Label.
    2. In the Add Label dialog box, click Add Label.
    3. Enter a key and value.
      • The key contains 1 to 63 characters. Start and end with a letter or digit. Only use digits, letters, underscores (_), hyphens (-), and periods (.). The key cannot be the built-in app, casid, or version.
      • The value contains 0 to 63 characters. Start and end with a letter or digit. Only use digits, letters, underscores (_), hyphens (-), and periods (.).

      It is recommended that you create a predefined tag on TMS to add the same tag to different resources.

    4. Click OK.

    Description

    Component description.

    1. Click and enter up to 128 characters.
    2. Click to save the component description.

  6. In the Component Package area, configure the component package by referring to the following table. Parameters marked with an asterisk (*) are mandatory.

    Parameter

    Description

    *Stack

    1. Select a component technology stack type based on the component deployment mode. For details, see Table 1.

      Only enabled technology stacks in the Enabling state can be selected. For details, see Enabling a Technology Stack.

    2. Select a technology stack version from the Name drop-down list.

      Only enabled technology stack versions in the Enabling state can be selected. For details, see Enabling a Technology Stack Version.

    3. Set JVM to configure the memory parameter size during Java code running. This parameter is available when a Java or Tomcat technology stack is selected.

      Click Stack Settings and enter the JVM parameter. For example:

      -Xms256m -Xmx1024m

      Multiple parameters are separated by spaces.

    4. Set Tomcat to configure the parameters such as Tomcat request path and port number. This parameter is available when a Tomcat technology stack is selected.
      1. Click Stack Settings and select Tomcat. The Tomcat dialog box is displayed.
      2. Click Use Sample Code and edit the template file based on service requirements.

        In Tomcat configuration, the default server.xml configuration is used. The context path is /, and no application path is specified. If you need to customize an application path, customize the Tomcat context path by referring to How Do I Customize a Tomcat Context Path?

      3. Click OK.

    *Source Code/Software Package

    Select a software package (JAR package, WAR package, ZIP package, or package).

    The package type is determined by the selected technology stack type. For details, see Table 1.

    *Upload Method

    If the package type is software package, select an uploaded software package. For details about the upload method, see Component Source.

    If the package type is software package and you need to use JFrog (example) as the software package repository, you can select Custom file address.

    1. Enter the HTTP/HTTPS custom file address where the software package is located.
    2. Determine whether to enable authentication.
      • If authentication is disabled, any user can download the software package in the custom file address by default.
      • Click to enable authentication. Only authenticated users can download the software package in the custom file address. Authentication mode can be User name and password authentication or User-defined Header Authentication. The authentication mode and the corresponding authentication parameters are determined by the authentication mode supported by the server where the custom file directory is located.

  7. Perform the following operations based on whether to continue setting component parameters:

    • If yes, click Next and go to 5.
    • If no, click Save as Draft.

      The component is saved as a draft in the component list of the application selected in 5. When you create a component but do not complete the parameter settings, you can save the draft to prevent the parameters from being lost due to factors such as page closing. You can use the saved component draft to continue creating a component.

  8. In the Resources area, set the resources required by the component.

    • If ECS is selected for Resource Type, select the ECS that has been managed in the component deployment environment.
    • If AS is selected for Resource Type, select the AS group to be used from Resources and then select the ECS in the AS group.
    • If Custom servers is selected for Resource Type, select the custom server that has been managed in the component deployment environment.

    The selected servers must have the VM agent installed and be running properly.

  9. In the Access Mode area, enable Public Network Access.

    After public network access is enabled for a component, you can use a public network domain name to access the component through an ELB bound with an EIP to use services provided by the component.

    Click to enable public access and set the following parameters:
    1. Set Public Network Load Balancer.

      An EIP has been bound to the load balancer and must be in the same VPC and subnet as the compute resources managed in the current component deployment environment. Components must be bound with different load balancers in different deployment environments to avoid route errors.

      • Select a load balancer that has been bound to an EIP in the selected environment.
      • If no load balancer exists, click Add One. On the Edit Environment page that is displayed, click Add Optional Resource to add created load balancers to the environment.
      • To create ELB resources:
    2. Set Client Protocol.
      • HTTP has security risks. You are advised to select HTTPS.
      • If HTTPS is selected, click Use existing to select an existing certificate.

        If no certificate exists, click Create new to create a server certificate. For details, see Adding a Certificate.

    3. Set Domain Name.
      • If Automatically generated is selected, the automatically generated domain name is valid only for seven days.
      • If Bound is selected, enter a domain name.

      After a component with public network access enabled is created and deployed, you can change the configured component access domain name by referring to Changing the Component Access Domain Name.

  10. Set Cloud Service Settings.

    Operation Type

    Operation

    Description

    Microservice Engine

    Binding a microservice engine

    Cloud Service Engine is a one-stop management platform for microservice solutions. After microservice components are connected to CSE, you can use service registry, service governance, and configuration management of CSE. In this way, you can focus on service development and improve product delivery efficiency and quality.

    Choose Cloud Service Settings > Microservice Engine and bind a microservice engine. For details, see Binding a Microservice Engine.

    Distributed Cache Service

    Binding a distributed cache

    In a distributed system, the distributed cache service provides scalable and reliable user session management.

    Choose Cloud Service Settings > Distributed Cache Service and bind a distributed cache. For details, see Binding a Distributed Cache.

    Relational Database Service

    Binding a cloud database

    RDS is required for persistent storage of application data.

    Choose Cloud Service Settings > Relational Database Service and bind a cloud database. For details, see Binding a Cloud Database.

    GaussDB

    Binding a GaussDB instance

    GaussDB is required for persistent storage of application data.

    Choose Cloud Service Settings > GaussDB and bind a GaussDB instance. For details, see Binding a GaussDB Instance.

    Distributed Message Service for RocketMQ

    Binding a DMS for RocketMQ instance

    DMS for RocketMQ is required for application components to store and consume messages.

    Choose Cloud Service Settings > Distributed Message Service for RocketMQ and bind a RocketMQ instance. For details, see Binding a DMS for RocketMQ Instance.

    Cloud Search Service

    Binding a CSS instance

    Uses the multi-condition search, statistics, and report capabilities of structured and unstructured text provided by the Elasticsearch cluster of Cloud Search Service (CSS) to analyze component logs in all scenarios.

    Choose Cloud Service Settings > Cloud Search Service and bind a CSS instance. For details, see Binding a CSS Instance.

  11. Set VM Settings.

    Set VM settings by referring to Configuring VM Settings.

  12. Set Application Settings.

    Bind the created configuration file to the component by referring to Managing Application Settings of a VM-Deployed Component. This implements multi-environment component release and upgrade with one-time configuration through file mounting.

  13. Set Advanced Settings.

    For details, see Configuring Application Performance Management of a VM-Deployed Component.

  14. Set Log Settings.

    Log Settings can be set for components deployed on the ECS managed in the environment. For details, see Configuring Log Settings of a VM-Deployed Component.

  15. Perform subsequent operations based on whether to deploy the component by referring to the following table.

    Deploy or Not

    Procedure

    Yes

    Click Create and Deploy.

    • On the View Deployment History page, view the deployment logs and wait until the component deployment is complete.

      If "Creation of the VM application instance failure", "Query of the VM task status failure", or "Query of the VM application instance status failure" is displayed, click View Event to view details in the event list.

    • During component deployment, if the component configuration is incorrect, you can click Suspend to stop the deployment. Then, click Upgrade and reconfigure the component by referring to Upgrading a Component in Rolling Release Mode.

    No

    Click Save as Draft.

    The component is saved as a draft in the component list of the application selected in 5. When you create a component but do not complete the parameter settings, you can save the draft to prevent the parameters from being lost due to factors such as page closing. You can use the saved component draft to continue creating a component.

Follow-up Operations