Skip to main content
Create a cloud server with an emulated USB drive

Create a cloud server with an emulated USB drive

carefully

You cannot directly connect a USB storage device to a cloud server. To connect a USB storage device, create a cloud server with a disk emulated as a USB storage device.

You may need to connect a USB storage device to import various files to the cloud server. For example, to import and use cryptographic information security tools (CPS). To connect a USB storage device, create a cloud server with a disk emulated as a USB storage device.

  1. Prepare the file.

  2. Create a USB drive image with the file.

  3. Configure the OpenStack CLI.

  4. Download the image.

  5. Create a flavor.

  6. Create a cloud server.

1. Prepare the file

Prepare the file you want to import to the cloud server. The preparation process depends on the type of file to be imported.

2. Create a USB flash drive image with the file

  1. Open the CLI.

  2. Create a USB drive image with the prepared file.

    dd if=<disk_name> of=<image_name>.iso bs=4M

    Specify:

    • <disk_name> — name of the disk on which the prepared file is located — the source disk;
    • <image_name> — name of the image that is created from the source disk.

3. Configure the OpenStack CLI

Use the instructions Configure OpenStack CLI with OS tools or Configure OpenStack CLI in a Docker container.

4. Download the image

Use the instructions to Load an image from a file.

5. Create a flavor

The Flavor will only be available for the project and pool that you authorized to work with the OpenStack API when you configured the OpenStack CLI in step 3.

  1. Open the OpenStack CLI.

  2. Create a flavor:

    openstack flavor create \
    --private \
    --vcpus <vcpu> \
    --ram <ram_size> \
    --disk <disk_size> \
    <flavor_name>

    Specify:

    • <vcpu> — number of vCPUs;
    • <ram_size> — RAM size in MB;
    • optional: <disk_size> — local disk size in GB. To create a flavor with a network disk, the value must be zero;
    • <flavor_name> — flavor name. It must be unique and not coincide with the names of previously deleted flavors. The list of existing flavors can be viewed with the command openstack flavor list.
    Example of a customized flavor

    Flavor with 2 vCPUs, 2 GB RAM, 80 GB local disk size

    openstack flavor create \
    --private\
    --vcpus 2\
    --ram 2048\
    --disk 80\
    new_flavor

6. Create a cloud server

  1. Open the OpenStack CLI.

  2. Create a cloud server:

        openstack server create \
    --image <image> \
    --flavor <flavor> \
    --availability-zone <pool_segment> \
    --nic net-id=<net_uuid> \
    --security-group <security_group> \
    --block-device source_type=image,uuid=<uploaded_image>,destination_type=volume,disk_bus=usb,device_type=disk,volume_size=<size> <server_name>

    Specify:

    • <image> — to create a server from a ready-made or custom image. Parameter <image> — ID or name of the image. The image must be in the same pool as the server. The list of images can be viewed with openstack image list;
    • <flavor> — The ID or name of the flavor. Flavors correspond to cloud server configurations and define the number of vCPUs, RAM, and local disk size of the server. You can use fixed configuration flavor or create a flavor. For example, 4011 — ID to create a Memory Line fixed configuration server with 2 vCPUs, 16 GB RAM in a ru-9 pool. You can view the list of flavors using the command openstack flavor list or in the table List of fixed configuration flavors in all pools;
    • <pool_segment> — pool segment in which the cloud server will be created, e.g. ru-9a. The list of available pool segments can be found in the instructions. Availability matrices;
    • <net_uuid> — ID of the private or public network to which the server will be connected. The list of networks can be viewed with the command openstack network list;
    • <security_group> — The ID or name of the security group. To create a server with a security group, port security must be enabled on the network. port security. The list of groups can be viewed with the command openstack security group list;
    • <uploaded_image> — ID of the uploaded disk image with prepared file. Can be viewed in control panel: in the top menu, click ProductsCloud ServersImages → in the image card in the UUID line, click ;
    • <size> — disk size in GB. The minimum disk size must be equal to the size of the source disk. Take into account network disk limits on the maximum size;
    • <server_name> — server name.