Skip to main content

Create a cloud server with an emulated USB drive

Last update:
For your information

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

Connecting a USB drive may be required to import various files to a cloud server. For example, for importing and using cryptographic information protection tools (CIPFs). To connect a USB drive, create a cloud server with a disk emulated as a USB drive.

  1. Prepare the file.

  2. Create a USB drive image with the file.

  3. Configure OpenStack CLI.

  4. Upload the image.

  5. Create a flavor.

  6. Create a cloud server.

1. Prepare the file

Prepare the file that you need to import to the cloud server. The preparation process depends on the type of file being imported.

2. Create a USB 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> — the name of the disk containing the prepared file — the source disk;
    • <image_name> — the name of the image created from the source disk.

3. Configure OpenStack CLI

Use the Configure OpenStack CLI via OS or Configure OpenStack CLI in a Docker container instruction.

4. Upload the image

Use the Upload an image from a file instruction.

5. Create a flavor

The flavor will be available only for the project and pool you authenticated with to work with OpenStack API while configuring 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 volume, the value must be zero;
    • <flavor_name> — flavor name. It must be unique and must not match the names of previously deleted flavors. You can view the list of existing flavors using the openstack flavor list command.
    Example of a configured flavor

    A flavor with 2 vCPUs, 2 GB RAM, and a local disk size of 80 GB

    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. The <image> parameter is the image ID or name. The image must be in the same pool as the server. You can view the list of images using openstack image list;
    • <flavor> — flavor ID or name. Flavors correspond to cloud server configurations and determine the number of vCPUs, RAM, and the local disk size. You can use fixed configuration flavors or create your own. For example, 1015 — the ID for creating a server with a fixed configuration from the Standard line with 4 vCPUs and 16 GB RAM in pool ru-9. You can view the list of flavors using the openstack flavor list command or in the List of fixed configuration flavors across all pools table;
    • <pool_segment>pool segment in which the cloud server will be created, for example ru-9a. You can view the list of available pool segments in the Availability matrix guide;
    • <net_uuid> — ID of the private or public network to which the server will be connected. You can view the list of networks using the openstack network list command;
    • <security_group> — security group ID or name. To create a server with a security group, traffic filtering (port security) must be enabled in the network. You can view the list of groups using the openstack security group list command;
    • <uploaded_image> — ID of the uploaded disk image with a prepared file. You can find it in the Control Panel: in the top menu, click ProductsCloud ServersImages → in the image card, in the UUID row, click ;
    • <size> — disk size in GB. The minimum disk size must be equal to the source disk size. Consider network volume limits for the maximum size;
    • optional: --property x_cloud_smt_enabled=false — disable Hyper-Threading (SMT). If this parameter is not specified, Hyper-Threading (SMT) will be enabled by default. Can only be used with flavors that support dedicated cores. You can view the list of flavors in the List of fixed configuration flavors across all pools table;
    • optional: --property x_cloud_numa_nodes=1 — pin resources to a single NUMA node. Can only be used with flavors that support dedicated cores. You can view the list of flavors in the List of fixed configuration flavors across all pools table;
    • <server_name> — server name;