All Products
Search
Document Center

Alibaba Cloud Service Mesh:Manage virtual services

Last Updated:Mar 11, 2026

When you run multiple versions of a service in a Service Mesh (ASM) instance, you need fine-grained control over which requests go where. Virtual services solve this by defining routing rules that match requests -- based on headers, URI paths, or traffic weight -- and forward them to specific service versions (subsets). Rules are evaluated top to bottom, and the first match takes effect.

Use virtual services to:

  • Route traffic to specific service versions (for example, send all test-user requests to v2).

  • Split traffic across versions by weight (for example, shift 10% of traffic to a canary deployment).

  • Match requests by header, URI, or other attributes and route them to different backends.

Important

Virtual services work together with destination rules. A virtual service routes traffic to a destination, while a destination rule configures what happens at that destination (load balancing, connection pools, subset definitions). If your virtual service references a subset, the corresponding DestinationRule must define that subset. For the complete VirtualService field reference, see Virtual Service in the Istio documentation.

Prerequisites

Before you begin, make sure that you have:

  • An ASM instance. For more information, see Create an ASM instance

  • Services deployed to a cluster added to the ASM instance

Create a virtual service

  1. Log on to the ASM console.

  2. In the left-side navigation pane, choose Service Mesh > Mesh Management.

  3. On the Mesh Management page, click the name of the ASM instance.

  4. In the left-side navigation pane, choose Traffic Management Center > VirtualService.

  5. Create a virtual service by using one of the following methods:

    • Console form: Click Create. Configure the parameters on the Create page, and then click Create.

    • YAML editor: Click Create from YAML. Select a namespace from the Namespace drop-down list and select a template from the Template drop-down list. Edit the YAML configuration in the code editor, and then click Create.

Modify a virtual service

After a virtual service is created, find it on the VirtualService page and use the Actions column to make changes:

  • Edit the YAML configuration: Click YAML. In the Edit dialog box, modify the configuration and click OK.

  • Roll back to a previous version: Click Version. In the Version dialog box, modify the configurations as needed and click Rollback.

Delete a virtual service

  1. On the VirtualService page, find the virtual service and click Delete in the Actions column.

  2. In the Submit confirmation message, click OK.

Important

Deleting a virtual service removes its routing rules, which affects how requests are routed and how traffic is distributed across service versions. This may cause unexpected behavior. Before you delete, verify that no active traffic depends on the routing rules defined in the virtual service.

Related topics

  • Create destination rules to define subsets and configure load balancing policies for your services. For more information, see Manage destination rules.

  • Configure gateways to manage ingress traffic into your mesh. For more information, see Manage gateways.