# SCP::VirtualServer::VirtualServer

LLMS index: [llms.txt](https://docs.e.samsungsdscloud.com/en/templatereference/compute/virtual-server/llms.txt)

---

```
SCP::VirtualServer::VirtualServer
```





## Description
A Virtual Server resource of the SCP Virtual Server service that provides a virtual server.

## Version
`1.5.0`

## Syntax

To declare this entity in your Infrastructure Builder template, use the following syntax:

**JSON**
```json
{
  "Type" : "SCP::VirtualServer::VirtualServer",
  "Properties" : {
    "Networks" : [Networks, ...],
    "ImageId" : "String",
    "KeypairName" : "String",
    "Lock" : "Boolean",
    "Metadata" : "Metadata",
    "Name" : "String",
    "ProductCategory" : "String",
    "ProductOffering" : "String",
    "SecurityGroups" : [String],
    "UserData" : "String",
    "ServerGroupId" : "String",
    "ServerTypeId" : "String",
    "BootVolume" : "BootVolume",
    "ExtraVolumes" : [ExtraVolumes, ...],
    "Zone" : "String"
  }
}

```

**YAML**
```yaml
Type: SCP::VirtualServer::VirtualServer
Properties:
  Networks: 
    - Networks
  ImageId: String
  KeypairName: String
  Lock: Boolean
  Metadata: Metadata
  Name: String
  ProductCategory: String
  ProductOffering: String
  SecurityGroups: [String]
  UserData: String
  ServerGroupId: String
  ServerTypeId: String
  BootVolume: BootVolume
  ExtraVolumes: 
    - ExtraVolumes
  Zone: String

```

## Properties


### Networks

The list of networks to connect to the server. Up to 5 networks can be specified, and at least one must belong to a public or private subnet. Use either subnet IDs or port IDs across the whole list, never both.

| Attribute | Value |
|-----------|-------|
| **Required** | Yes |
| **Type** | Array of Networks |
| **Update requires** | No interruption |




> For more information, see [Networks](/en/templatereference/compute/virtual-server/scp_virtualserver_virtualserver/networks/).



### ImageId

The identifier of the Image that specifies the OS image to use for the server.

| Attribute | Value |
|-----------|-------|
| **Required** | Yes |
| **Type** | String |
| **Update requires** | Replacement |






### KeypairName

The name of the keypair used for SSH access to the server.

| Attribute | Value |
|-----------|-------|
| **Required** | Yes |
| **Type** | String |
| **Update requires** | Replacement |






### Lock

Whether to lock the server immediately after it is created. Defaults to false.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | Boolean |
| **Update requires** | No interruption |






### Metadata

Key-value pairs that the platform stores on the server.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | Metadata |
| **Update requires** | Replacement |






### Name

The name of the server.

| Attribute | Value |
|-----------|-------|
| **Required** | Yes |
| **Type** | String |
| **Pattern** | `^[a-zA-Z0-9-_ ]*$` |
| **Length constraints** | 1–63 |
| **Update requires** | No interruption |






### ProductCategory

The product category of the server.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | String |
| **Update requires** | Replacement |






### ProductOffering

The product offering of the server.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | String |
| **Update requires** | Replacement |






### SecurityGroups

The list of security group identifiers to associate with the server.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | Array of String |
| **Update requires** | No interruption |






### UserData

The user data script that runs on the server at startup, base64-encoded. Plain text must be wrapped with Fn::Base64 in the template. Values that are not valid base64 are passed to the service as-is and rejected by the API. The maxLength limit applies to the base64-encoded value.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | String |
| **Length constraints** | Max: 65535 |
| **Update requires** | Replacement |






### ServerGroupId

The identifier of the server group in which the server is placed.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | String |
| **Update requires** | Replacement |






### ServerTypeId

The identifier of the server type of the server, for example s1v1m2.

| Attribute | Value |
|-----------|-------|
| **Required** | Yes |
| **Type** | String |
| **Update requires** | No interruption |






### BootVolume

Boot volume settings that define the root disk where the OS is installed.

| Attribute | Value |
|-----------|-------|
| **Required** | Yes |
| **Type** | BootVolume |
| **Update requires** | Replacement |




> For more information, see [BootVolume](/en/templatereference/compute/virtual-server/scp_virtualserver_virtualserver/bootvolume/).



### ExtraVolumes

Extra volume settings that define additional volumes to attach to the server besides the boot volume.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | Array of ExtraVolumes |
| **Update requires** | No interruption |




> For more information, see [ExtraVolumes](/en/templatereference/compute/virtual-server/scp_virtualserver_virtualserver/extravolumes/).



### Zone

The availability zone in which the server is located.

| Attribute | Value |
|-----------|-------|
| **Required** | Yes |
| **Type** | String |
| **Update requires** | Replacement |







## Return Values

### Ref

When you pass the logical ID of this resource to the `Ref` function, Ref returns the value of the **Id**.


### Fn::GetAtt

| Attribute | Description |
|-----------|-------------|
| **AccountId** | The identifier of the account that owns the server. |
| **Networks** | The list of networks to connect to the server. Up to 5 networks can be specified, and at least one must belong to a public or private subnet. Use either subnet IDs or port IDs across the whole list, never both. |
| **AutoScalingGroupId** | The identifier of the Auto Scaling Group that created the server. It has a value only for servers created by an Auto Scaling Group. |
| **DiskConfig** | The disk configuration mode of the server. |
| **ImageId** | The identifier of the Image that specifies the OS image to use for the server. |
| **KeypairName** | The name of the keypair used for SSH access to the server. |
| **LaunchConfigurationId** | The identifier of the launch configuration that created the server. It has a value only for servers created by an Auto Scaling Group. |
| **Lock** | Whether to lock the server immediately after it is created. Defaults to false. |
| **Name** | The name of the server. |
| **PlannedComputeOsType** | The planned OS type of the server. |
| **ProductCategory** | The product category of the server. |
| **ProductOffering** | The product offering of the server. |
| **SecurityGroups** | The list of security group identifiers to associate with the server. |
| **UserData** | The user data script that runs on the server at startup, base64-encoded. Plain text must be wrapped with Fn::Base64 in the template. Values that are not valid base64 are passed to the service as-is and rejected by the API. The maxLength limit applies to the base64-encoded value. |
| **ServerGroupId** | The identifier of the server group in which the server is placed. |
| **ServerTypeId** | The identifier of the server type of the server, for example s1v1m2. |
| **State** | The current state of the server. |
| **ExtraVolumes** | Extra volume settings that define additional volumes to attach to the server besides the boot volume. |
| **VpcId** | The identifier of the VPC that the server belongs to. |
| **PartitionNumber** | The partition number of the server. It is only used when the server group type is partition. |
| **Zone** | The availability zone in which the server is located. |


## Sample Template

### Create a virtual server with a keypair and security group
Creates a virtual server with an existing keypair and security group

```yaml
SCPTemplateFormatVersion: '2026-01-01'
Description: '표준(공용) 이미지를 사용하는 가상 서버(Compute) 생성 템플릿'
Parameters:
  VpcName:
    Type: String
    Default: 'sample-vpc'
    MinLength: 3
    MaxLength: 20
    AllowedPattern: '^[a-zA-Z0-9-]*$'
    Description: 'VPC 이름을 입력하세요. (3~20자, 영문/숫자/하이픈만 허용)'
  VpcCidr:
    Type: CommaDelimitedList
    Default: '10.0.0.0/16'
    Description: 'VPC의 CIDR 블록을 입력하세요. (/16 ~ /24)'
  SubnetName:
    Type: String
    Default: 'sample-subnet'
    MinLength: 3
    MaxLength: 20
    AllowedPattern: '^[a-zA-Z0-9-]*$'
    Description: 'Subnet 이름을 입력하세요. (3~20자, 영문/숫자/하이픈만 허용)'
  SubnetCidr:
    Type: String
    Default: '10.0.1.0/24'
    Description: 'Subnet의 CIDR 블록을 입력하세요. (VPC CIDR 범위 내)'
  SecurityGroupName:
    Type: String
    Default: 'sample-sg'
    MinLength: 1
    MaxLength: 255
    Description: 'Security Group 이름을 입력하세요. (1~255자)'
  ServerName:
    Type: String
    Default: 'sample-server'
    MinLength: 1
    MaxLength: 63
    AllowedPattern: '^[a-zA-Z0-9-_ ]*$'
    Description: '가상 서버 이름을 입력하세요. (1~63자, 영문/숫자/하이픈/언더스코어/공백 허용)'
  ImageId:
    Type: String
    MinLength: 1
    Description: '가상 서버에 사용할 표준(공용) 이미지 ID를 입력하세요. (플랫폼의 표준 이미지 목록(가상 서버 서비스 콘솔의 이미지 화면)에서 ID 확인, 필수)'
  KeypairName:
    Type: String
    MinLength: 1
    Description: 'SSH 접속에 사용할 키페어 이름을 입력하세요. (필수)'
  ServerTypeId:
    Type: String
    Default: 's1v1m2'
    Description: '가상 서버 타입 ID를 입력하세요. (예: s1v1m2. ※ 예시 값 - 리전/이미지에 맞는 타입으로 수정)'
  Zone:
    Type: String
    Default: 'kr-west1-a'
    Description: '가상 서버가 생성될 존을 입력하세요. (예: kr-west1-a. ※ 예시 값 - 리전에 맞는 존으로 수정)'

Resources:
  MyVpc:
    Type: SCP::VPC::Vpc
    Properties:
      Name: !Ref VpcName
      Cidrs: !Ref VpcCidr
  MySubnet:
    Type: SCP::VPC::Subnet
    Properties:
      Name: !Ref SubnetName
      VpcId: !Ref MyVpc
      Cidr: !Ref SubnetCidr
      Type: PRIVATE
      Category: PRIMARY
  MySecurityGroup:
    Type: SCP::SecurityGroup::SecurityGroup
    Properties:
      Name: !Ref SecurityGroupName
  MySecurityGroupIngressSsh:
    Type: SCP::SecurityGroup::SecurityGroupRule
    Properties:
      SecurityGroupId: !Ref MySecurityGroup
      Direction: ingress
      Ethertype: IPv4
      Protocol: tcp
      PortRangeMin: 22
      PortRangeMax: 22
      RemoteIpPrefix: 0.0.0.0/0
  MyServer:
    Type: SCP::VirtualServer::VirtualServer
    Properties:
      Name: !Ref ServerName
      ImageId: !Ref ImageId
      KeypairName: !Ref KeypairName
      ServerTypeId: !Ref ServerTypeId
      Zone: !Ref Zone
      Networks:
        - SubnetId: !Ref MySubnet
      SecurityGroups:
        - !Ref MySecurityGroup
      BootVolume:
        Size: 40
        Type: SSD

Outputs:
  ServerId:
    Description: "생성된 가상 서버의 ID입니다."
    Value: !Ref MyServer

```

### UserData bootstrap
Passes a script to run at server boot via UserData

```yaml
SCPTemplateFormatVersion: '2026-01-01'
Description: 'UserData 부트스트랩 스크립트를 사용하는 가상 서버 생성 템플릿'
Parameters:
  VpcName:
    Type: String
    Default: 'sample-vpc'
    MinLength: 3
    MaxLength: 20
    AllowedPattern: '^[a-zA-Z0-9-]*$'
    Description: 'VPC 이름을 입력하세요. (3~20자, 영문/숫자/하이픈만 허용)'
  VpcCidr:
    Type: CommaDelimitedList
    Default: '10.0.0.0/16'
    Description: 'VPC의 CIDR 블록을 입력하세요. (/16 ~ /24)'
  SubnetName:
    Type: String
    Default: 'sample-subnet'
    MinLength: 3
    MaxLength: 20
    AllowedPattern: '^[a-zA-Z0-9-]*$'
    Description: 'Subnet 이름을 입력하세요. (3~20자, 영문/숫자/하이픈만 허용)'
  SubnetCidr:
    Type: String
    Default: '10.0.1.0/24'
    Description: 'Subnet의 CIDR 블록을 입력하세요. (VPC CIDR 범위 내)'
  SecurityGroupName:
    Type: String
    Default: 'sample-sg'
    MinLength: 1
    MaxLength: 255
    Description: 'Security Group 이름을 입력하세요. (1~255자)'
  ServerName:
    Type: String
    Default: 'sample-server'
    MinLength: 1
    MaxLength: 63
    AllowedPattern: '^[a-zA-Z0-9-_ ]*$'
    Description: '가상 서버 이름을 입력하세요. (1~63자, 영문/숫자/하이픈/언더스코어/공백 허용)'
  ImageId:
    Type: String
    MinLength: 1
    Description: '가상 서버에 사용할 표준(공용) 이미지 ID를 입력하세요. (플랫폼의 표준 이미지 목록(가상 서버 서비스 콘솔의 이미지 화면)에서 ID 확인, 필수)'
  KeypairName:
    Type: String
    MinLength: 1
    Description: 'SSH 접속에 사용할 키페어 이름을 입력하세요. (필수)'
  ServerTypeId:
    Type: String
    Default: 's1v1m2'
    Description: '가상 서버 타입 ID를 입력하세요. (예: s1v1m2. ※ 예시 값 - 리전/이미지에 맞는 타입으로 수정)'
  Zone:
    Type: String
    Default: 'kr-west1-a'
    Description: '가상 서버가 생성될 존을 입력하세요. (예: kr-west1-a. ※ 예시 값 - 리전에 맞는 존으로 수정)'
  UserDataScript:
    Type: String
    Description: '서버 부팅 시 실행할 부트스트랩 스크립트(일반 텍스트)를 입력하세요. (base64 인코딩된 값 기준 최대 65,535자)'

Resources:
  MyVpc:
    Type: SCP::VPC::Vpc
    Properties:
      Name: !Ref VpcName
      Cidrs: !Ref VpcCidr
  MySubnet:
    Type: SCP::VPC::Subnet
    Properties:
      Name: !Ref SubnetName
      VpcId: !Ref MyVpc
      Cidr: !Ref SubnetCidr
      Type: PRIVATE
      Category: PRIMARY
  MySecurityGroup:
    Type: SCP::SecurityGroup::SecurityGroup
    Properties:
      Name: !Ref SecurityGroupName
  MySecurityGroupIngressSsh:
    Type: SCP::SecurityGroup::SecurityGroupRule
    Properties:
      SecurityGroupId: !Ref MySecurityGroup
      Direction: ingress
      Ethertype: IPv4
      Protocol: tcp
      PortRangeMin: 22
      PortRangeMax: 22
      RemoteIpPrefix: 0.0.0.0/0
  MyServer:
    Type: SCP::VirtualServer::VirtualServer
    Properties:
      Name: !Ref ServerName
      ImageId: !Ref ImageId
      KeypairName: !Ref KeypairName
      ServerTypeId: !Ref ServerTypeId
      Zone: !Ref Zone
      UserData:
        Fn::Base64: !Ref UserDataScript
      Networks:
        - SubnetId: !Ref MySubnet
      SecurityGroups:
        - !Ref MySecurityGroup
      BootVolume:
        Size: 40
        Type: SSD

Outputs:
  ServerId:
    Description: "생성된 가상 서버의 ID입니다."
    Value: !Ref MyServer

```

### Deploy multiple instances with a nested stack
Deploys N identical virtual servers using nested stacks. Used together with the [Nested stack virtual server template] template.

```yaml
SCPTemplateFormatVersion: '2026-01-01'
Description: '동일 가상 서버를 여러 대 중첩 스택으로 배포하는 템플릿'
Parameters:
  VpcName:
    Type: String
    Default: 'sample-vpc'
    MinLength: 3
    MaxLength: 20
    AllowedPattern: '^[a-zA-Z0-9-]*$'
    Description: 'VPC 이름을 입력하세요. (3~20자, 영문/숫자/하이픈만 허용)'
  VpcCidr:
    Type: CommaDelimitedList
    Default: '10.0.0.0/16'
    Description: 'VPC의 CIDR 블록을 입력하세요. (/16 ~ /24)'
  SubnetName:
    Type: String
    Default: 'sample-subnet'
    MinLength: 3
    MaxLength: 20
    AllowedPattern: '^[a-zA-Z0-9-]*$'
    Description: 'Subnet 이름을 입력하세요. (3~20자, 영문/숫자/하이픈만 허용)'
  SubnetCidr:
    Type: String
    Default: '10.0.1.0/24'
    Description: 'Subnet의 CIDR 블록을 입력하세요. (VPC CIDR 범위 내)'
  ImageId:
    Type: String
    MinLength: 1
    Description: '가상 서버에 사용할 표준(공용) 이미지 ID를 입력하세요. (필수)'
  KeypairName:
    Type: String
    MinLength: 1
    Description: 'SSH 접속에 사용할 키페어 이름을 입력하세요. (필수)'
  ServerTypeId:
    Type: String
    Default: 's1v1m2'
    Description: '가상 서버 타입 ID를 입력하세요. (예: s1v1m2. ※ 예시 값 - 리전/이미지에 맞게 수정)'
  Zone:
    Type: String
    Default: 'kr-west1-a'
    Description: '가상 서버가 생성될 존을 입력하세요. (예: kr-west1-a. ※ 예시 값 - 리전에 맞게 수정)'

Resources:
  MyVpc:
    Type: SCP::VPC::Vpc
    Properties:
      Name: !Ref VpcName
      Cidrs: !Ref VpcCidr
  MySubnet:
    Type: SCP::VPC::Subnet
    Properties:
      Name: !Ref SubnetName
      VpcId: !Ref MyVpc
      Cidr: !Ref SubnetCidr
      Type: PRIVATE
      Category: PRIMARY
  Server1:
    Type: SCP::InfrastructureBuilder::Stack
    Properties:
      TemplateURL: 'https://<자식 템플릿 배포 URL>/nested-server-template.yaml'
      Parameters:
        SubnetId: !Ref MySubnet
        ServerName: 'sample-server-1'
        ImageId: !Ref ImageId
        KeypairName: !Ref KeypairName
        ServerTypeId: !Ref ServerTypeId
        Zone: !Ref Zone
  Server2:
    Type: SCP::InfrastructureBuilder::Stack
    Properties:
      TemplateURL: 'https://<자식 템플릿 배포 URL>/nested-server-template.yaml'
      Parameters:
        SubnetId: !Ref MySubnet
        ServerName: 'sample-server-2'
        ImageId: !Ref ImageId
        KeypairName: !Ref KeypairName
        ServerTypeId: !Ref ServerTypeId
        Zone: !Ref Zone

Outputs:
  VpcId:
    Description: "생성된 VPC의 ID입니다."
    Value: !Ref MyVpc
  SubnetId:
    Description: "생성된 Subnet의 ID입니다."
    Value: !Ref MySubnet
  Server1Id:
    Description: "첫 번째 가상 서버의 ID입니다."
    Value: !GetAtt Server1.Outputs.ServerId
  Server2Id:
    Description: "두 번째 가상 서버의 ID입니다."
    Value: !GetAtt Server2.Outputs.ServerId

```

### Nested stack virtual server template
Defines a single virtual server invoked as a nested stack by the [Deploy multiple instances with a nested stack] template.

```yaml
SCPTemplateFormatVersion: '2026-01-01'
Description: '중첩 스택으로 배포되는 가상 서버 1대 (다중 인스턴스 샘플 자식 템플릿)'
Parameters:
  SubnetId:
    Type: String
    Description: 서버를 생성할 Subnet의 ID
  ServerName:
    Type: String
    Default: 'sample-server'
    MinLength: 1
    MaxLength: 63
    Description: '가상 서버 이름 (1~63자)'
  ImageId:
    Type: String
    MinLength: 1
    Description: '가상 서버 이미지 ID (필수)'
  KeypairName:
    Type: String
    MinLength: 1
    Description: '키페어 이름 (필수)'
  ServerTypeId:
    Type: String
    Default: 's1v1m2'
    Description: '가상 서버 타입 ID (예: s1v1m2)'
  Zone:
    Type: String
    Default: 'kr-west1-a'
    Description: '가용존 (예: kr-west1-a)'

Resources:
  MyServer:
    Type: SCP::VirtualServer::VirtualServer
    Properties:
      Name: !Ref ServerName
      ImageId: !Ref ImageId
      KeypairName: !Ref KeypairName
      ServerTypeId: !Ref ServerTypeId
      Zone: !Ref Zone
      Networks:
        - SubnetId: !Ref SubnetId
      BootVolume:
        Size: 40
        Type: SSD

Outputs:
  ServerId:
    Description: "생성된 가상 서버의 ID입니다."
    Value: !Ref MyServer

```

---

Section pages:

- [BootVolume](/en/templatereference/compute/virtual-server/scp_virtualserver_virtualserver/bootvolume/index.md)
- [ExtraVolumes](/en/templatereference/compute/virtual-server/scp_virtualserver_virtualserver/extravolumes/index.md)
- [Networks](/en/templatereference/compute/virtual-server/scp_virtualserver_virtualserver/networks/index.md)
