Instances Common Operations

Creating Instances

To create instances:

  1. In the Zadara Cloud Services application dashboad, navigate to the Compute > Instances view.

  2. Click the Create option. The Create Instance window is displayed.

compute-instances-create

The Create Instance wizard includes the following four tabs:

  1. Compute - The compute settings define the compute instances, their type, activation and quantity.

    compute-instances-create

    In the Compute tab, fill in the following properties :

    • Name - The display name for the instance.

    • Project - The destination project for the new instance.

    • Create From - The source of the new instance (image, ISO or Volume)

    • Instance Type - The instance type will define the amount of compute resource of the instance (CPU and RAM).

    • Key Pair - The set of security credentials that will be used to ensure the identity of the user when connecting to the instnace.

    • Options -
      • Power Up - Check this option to launch the instance immediately post creation.

      • High Availability - Check this option to ensure the instance is restarted in the event of a failure.

      • Protect from deletion - Check this option to protect the instance from accidental deletion.

    • Create Multiple - Define the quantity of instances that will be created.

  2. Storage - The storage tab will define the storage requirements for the new instance creation.

    create-instance-storage

    In the Storage tab, fill in the following properties :

    • Boot Volume - The Disk size and Storage Pool that will be used for the boot volume of the instance.

    • Data Volumes (optional) - Adding Additional volumes that will be used as data volumes (new or existing volumes can be attached).

  3. Networking - Define the the networking requirements for the new instance creation. Multiple networks can be added to the instance during creation.

    create-instance-networking

    In the Networking tab, fill in the following properties:

    • Network - The network that will be used for instance connectivity. Select from the existing list of networks or create a new network.

    • IP (optional) - Set a specific IP address for the interface.

    • DNS Name - Set the DNS name for the new instance.

    • Security Group - Select the security group that will be used to limit/allow connectivity to the instance.

    Important

    The MTU size for VMs with a Windows OS that use VxLAN-based networks, must not be greater than 1450.

  4. Config - The Config tab will collect optional configuration settings for the new instance.

    create-instance-config

    In the Config tab, fill in the following properties :

  • Cloud-init - The cloud-init file upload that will be injected to the instance post creation.

  • Tags - Select an existing or create a new tag for the new instance.

  • Metadata - Key-value set for additional Metadata configuration.

Starting Instances

By default, after instances are created they are in Shutoff state. To activate instances, run them.

To run instances:

In the Compute > Instances view, select the instance, click the Action icon, and then click Start. The Status on the selected VM changes to spawning, and a message box is displayed at the top right hand corner with the message “VM powering on”.

The selected VM is automatically placed on one of the nodes in the cluster, it starts running, and its status changes from Shutoff to Active.

Connecting to an Instance

Connect to an instance and access it using VNC.

To connect to an instance:

  1. In the Compute > Instances view, select the instance to which to connect.

  2. Click the Connect button. The VNC window is displayed.

  3. Click the Send Ctrl-Alt-Del button. The Instance is displayed.

    Operating System login credentials will be required.

Stopping Instances

To stop instances:

  1. In the Compute > Instances view, select the instance to stop.

  2. In the Actions menu select the Stop option. The instance stops, and its status changes from Active to Shutoff.

Adding Networks to a Virtual Machine

During the creation of a VM, attach the VM to a certain network. However, also change the network which was selected by detaching it and attaching another network, and attach more than one network to a certain VM.

The attaching and detaching of networks to/from a VM is done using the Networks widget or the Network view.

Attaching Networks to Instances

During the creation of instances, attach them to existing networks. However, after the creation of instances, attach to them other networks.

One network can be attached to numerous instances, and one instance can be attached to numerous networks.

  1. In the Networking > Networks Interfaces view, click a Network name. The Network view is displayed.

  2. In the Actions menu, click the Attach option. The Attach Network dialog box is displayed. Select the instance to attach to the network from the Virtual Machine drop-down list, and click OK.

The selected VM is now attached to this network, in addition to the network to which it was attached during its creation procedure.

Detaching Networks from Instances

Instances cannot be created without a network. However, change the network that is currently attached to instances by detaching them, and attaching another network to the instances. Before detaching a network from a running instance, it is recommended to stop the instances.

To detach networks from instances:

  1. In the Networking > Networks Interfaces view, click a Network name. The Network view is displayed.

  2. In the Networks view, select the VMs tab and then click Detach. The Network is detached from the current VM.

-OR-

Detach a network from a selected instance in the Compute > Instance view, as follows:

  1. In the Compute > Instance view, select the instance to detach from the network.

  2. In the Actions menu, select the Detach option. The instances will be detached from the network.

Adding More Storage to Virtual Machines

When launching an instance, a boot volume based on the image selected for that VM is automatically created. If more storage is needed, either extend the size of the boot volume, or attach additional volumes to the VM. Attaching a volume to an instance makes that volume available to the instance as a virtual disk that can be used for storage.

Extend the size of the volume

After creating a volume, extend its size. Extend the volume’s size whether or not the volume is attached to a VM.

  1. Using the GUI

    1. Display the list of volumes on the Storage > Block Storage view and click on the name of the volume to extend.

    2. In the More menu, click Extend. The Extend Volume dialog box is displayed.

    3. Specify the new size of the volume in GB. Note: The size cannot be decreased.

    4. Click OK. The volume will be extended to its new size. If the volume is attached to an instanc, there is no need to stop and re-start the instance in order for the instance to recognize the new size of the volume. Nevertheless, depending on the type of software found on the instance, user action may be necessary before the new capacity can be used; for example, resizing partitions, logical volumes, and/or file systems.

  2. Using the CLI

    1. If the volume is not attached to an instance, enter the following:

      volume extend volume_id size
      

      Verify that the new size is greater than the previous size.

    2. If the volume is attached to an instance, use the ‘vm resize’ command, as follows:

      vm resize vm_id [--volume-id VOLUME_ID] [--disk-size DISK_SIZE]
      

      There is no need to reboot the instance in order for the instance to recognize the new size of the volume. Nevertheless, depending on the type of software found on the instance, user action may be necessary before the new capacity can be used; for example, resizing partitions, logical volumes, and/or file systems.

Adding Storage to Instances

To make a volume available to an instance, it to the instance. Attach numerous volumes to one instance, but no volume can be attached to more than one instance.

  1. Display the list of volumes by clicking Menu > Storage > Block Storage.

  2. Click the name of the volume to attach > Attach > from the Virtual Machine drop down, select the VM to attach the volume to > OK.

  3. Stop and restart the VM: Stop: Menu > Compute > Instances > click  name of VM to stop > Stop Restart: Menu > Compute > Instances > click name of VM to restart > Start.

Note

A maximum of 24 volumes to an instance can be attached.

Migrating Instances to Different Nodes

By default, Zadara Cloud Services places a running instance on a certain node according to its internal analysis of the state of the cluster. When changes occur in the system load, performance, and scale, Zadara Cloud Services can automatically migrate the instance to another node to rebalance and optimize the system resources. In addition to the automatic placement and migration, Zadara Cloud Services enables you to determine on which node the VM will run, and allows you to move a VM from one node to another by using the Migrate option.

To migrate instances to another node:

  1. In the Compute > Instance view, select the instance. The Action menu is enabled and the selected instance details are displayed at the bottom window pane.

  2. To move the instance to another node, in the Action menu, select the Migrate button. The Migrate instance dialog box is displayed.

  3. In the Select Node drop-down list, select the node to migrate the instance to, and click OK. The status of the VM changes to Migrating during the migration process. Once the migration process ends, the status of the instance changes back to Active, and will be located in the selected node.

Creating Snapshots of Instances

Create snapshots of the instances that are in the system.

  1. In the ComputeInstances view, check the VM to create a snapshot for, and then click More.

  2. In the More menu, select Snapshot. The Create Snapshot dialog box is displayed.

  3. Enter a name for the new snapshot or accept the default name, which consists of the original VM name and the date-time stamp of the snapshot creation.

  4. (Optional) Enter the description of the snapshot, and click OK. A new snapshot is created. It is displayed in ComputeSnapshots.

Deleting Instances

Delete VMs that are in Shutoff status. To delete a running VM, stop it first, and then delete it from the system.

To delete a VM:

  1. In the Compute > Instances view, select the VM. The selected VM details appear at the bottom of the window. When VMs are running, click the Stop button to stop them first, since running machine cannot be deleted.

  2. In the Action menu, click the Delete button. The following message is displayed: “Are you sure you want to delete the VM?”

  3. Click OK to delete the VM. The VM is now deleted from the system.

Protecting Instances

After creating a VM, Protect it by assigning it to a Protection Group.

Protecting Instances via the Zadara Cloud Services GUI

  1. In the Compute > Instances view, select the VM to protect, and click on the More button.

  2. In the More menu, select the Protect option. The Protect Resource dialog box appears.

  3. In the Protection Group drop-down, select a protection group and click OK. In the Compute > Instances view of the VM, the Protection column will be checked. Note: This dialog box can also be used to remove a protection group from a VM.

Protecting Instances via the Zadara Cloud Services CLI

In the example below, we will protect a instance resource called ‘VM-1’ by assigning it to a protection group called ‘Protection_Group-1’.

Note

The resource and the protection group must be owned by the same project.

  1. Retrieve the ID of the instance,’VM-1’, together with its project_id.

    Zadara @ cloud_admin/default > `vm list -m columns='^id|^name|^project_id'`
    
    +--------------------------------------+------+----------------------------------+
    | id                                   | name | project_id                       |
    +======================================+======+==================================+
    | c4d017cf-04f4-4f85-9e21-1d067e1d384e | VM-1 | 08459aa189e849d0a47ddd985db594bd |
    +--------------------------------------+------+----------------------------------+
    
  2. Retrieve the ID of the protection group, ‘Protection-Group-1‘, together with its project_id.

    Zadara @ cloud_admin/default > *\ `protection groups list  -m columns='^id|^name|^project_id'`
    
  3. Verify that the instance and protection group are owned by the same project.

  4. Protect the instance, ‘VM-1’ by assigning it to the protection group, ‘Protection_Group-1’.

    Zadara @ cloud_admin/default > protection memberships create  0d6df1eb-0e3b-4b59-9669-ed620b6ad65d instance c4d017cf-04f4-4f85-9e21-1d067e1d384e
    
    =============== ==========================================
    Field           Value
    =============== ==========================================
    | id            | ff25527a-7b08-4b76-bbc7-b5715f9182c0
    | account_id    | default
    | created_at    | 2019-02-06T08:36:01.401731
    | group_id      | **0d6df1eb-0e3b-4b59-9669-ed620b6ad65d**
    | project_id    | 6666cfcf840f4a788cecfa6a3a00b2ee
    | resource_id   | **c4d017cf-04f4-4f85-9e21-1d067e1d384e**
    | resource_type | instance
    | triggered_at  | none
    | user_id       | admin
    =============== ==========================================
    
  5. The instance, ‘VM-1’ will now be protected according to the local backup schedule found in the protection group, ‘Protection-Group-1’.

Recovering Windows Instances

If a Windows-based VM that was imported from VMware or Hyper-V is prevented from having its storage and network drivers injected, it will not start properly (it will start in a blue screen). When this happens, the instance must first be started via the Recover button.

To recover a Windows VM:

  1. In the Compute > Instances > view, click the instance to be recovered. The detailed view of that instance is displayed.

  2. Click the More button and select the Recover option. The VM Recovery confirmation message is displayed.

  3. Click OK to recover the VM. This will install the storage and network drivers on the VM. In the next startup, start the Instance via the Start button.

Associating Security Groups with Instances

To limit the inbound and outbound traffic of a VM, associate a security group with it.

Note

If a security group is not specified, a port is associated with a default security group. The default security group allows both ingress and egress traffic. Security rules can be added to the default security group to change the traffic behavior.

  1. In the Compute > Instances view, click the name of the instances with which to associate a security group. This accesses the view of the selected instance in the Overview tab.

  2. Display the Security Groups tab, and click Attach Security Group. The Attach Security Group dialog box appears

  3. Select the Security Group which to associate the instance with, and the Network on the instance to whose port this Security Group will be attached, and click OK. The selected instance is now associated with a Security Group.

Attaching Floating IP’s to Instances

Note

This section is work-in-progress.

Secure SSH Access to Instances

Use Zadara Cloud Services to enable secure SSH access to instances using key pairs.

To do this:

  1. Generate a key pair and register it with Zadara Cloud Services.

  2. Create the VM and, during creation, associate the VM with the key pair that was just registered with Zadara Cloud Services. Attach the the edge network’s floating IP to the VM.

  3. SSH into the VM, plugging in the floating IP and the private key.

Generate Key Pairs

Using System Generated Key-Pairs

To generate a key pair:

  1. Click Compute > Key Pairs, and then click Create. The Generate Key Pair wizard is displayed.

    generate-key-pair-1

  2. Enter a unique name. The instance type name may consist of only letters, numbers, spaces, underscores, periods and dashes. It must begin and end with a letter, number or an underscore.

  3. Select the Generate a key pair and download the private key radio button.

  4. Click Next. The system displays the Result tab.

    generate-key-pair-2

In the Results tab, the system generated public key (which it keeps), and a private key (need to download) are displayed.

  • The system displays the Name of the key pair.

  • The system displays the Public Key’s fingerprint.

  1. Click Save. The system also displays a Save button, along with a message to save the private key. When clicking the Save button, the system downloads the private key to your browser’s default download location. The private key file is named:<name>.pem Where <name> is the name of the key pair which was specified in the Details tab.

Using User Generated Key Pairs and Public Key Registers

  1. Start by using a tool of your choice to generate a key pair (public and private key). Example: $ ssh-keygen. Change the file permissions on the private key to 400 or 600 to secure the key. Example: $ chmod 400 id_rsa

  2. Register the public key with Zadara Cloud Services. Click Compute > Key Pairs, and then select Create. The Generate Key Pair wizard is displayed.

    generate-key-pair-1

  3. Select the Upload a public key for a key pair you have generated using another tool radio button. The system displays the Public Key dialog box.

    generate-public

  4. Drag-and-drop the public key file into the dialog box, or click the Browse button and navigate to it. The Public Key is generated.

  5. Click the Next button. The system displays the Result tab.

Create Instances and Specify Key Pairs and Floating IP’s

Create an instance and during creation associate the instance with the key pair which was just registered with Zadara Cloud Services. Attach the edge network’s floating IP to the instance.

Associate Key Pairs with Instances

Associate a key pair with an instance as part of the instance creation process.

  1. In the Zadara Cloud Services application dashboad, navigate to the Compute > Instances view.

  2. Click the Create option. The Create Instance window is displayed.

  3. Click the Key Pair drop-down and select the key pair to inject into the VM.

Attach Floating IP to VM:

  1. After creating the VM, click:

Compute > Instances > name of VM. This displays the details view.

  1. Click the Floating IPs tab, then the Attach button. Select a floating IP from the Floating IP drop down menu.

SSH into the VM

Now SSH into the VM, using the following syntax:

$ ssh -i <private_key_file> <default_username_for_image>@<floating_ip>

In the following example, the private key file is id_rsa, and the default username for the image that the VM is based on is fedora. The floating IP is 192.237.248.66.

Example:

$ ssh -i id_rsa fedora@192.237.248.66

Key Pairs

Public–key cryptography is used to encrypt and decrypt login information for most of the instances created in Zadara Cloud Services. (Instances created from a Windows image are accessed by a password instead.) A public key is used to encrypt a piece of data, and then the recipient uses the private key to decrypt the data. These two keys are known as a key pair. Key pairs enable securely accessing instances using a private key instead of a password.

  1. Creating a Key Pair

    1. In the Compute > Key Pairs view click Create. The Generate Key Pair wizard > Details tab is displayed.

      generate-key-pair-1

    2. Name - Enter a unique name. The instance type name may consist of only letters, numbers, spaces, underscores, periods and dashes. It must begin and end with a letter, number or an underscore.

    3. Public key source

      • To generate a new key pair, then select the first option and click Next.

      • To upload the public key from a key pair generated by another tool, then select the second option. This displays a widget for uploading a file with a public key.

        generate-key-pair-1

        Drag and Drop or Browse the public key file and click Next. The Result step of the Generate Key Pair wizard is displayed.

        generate-public

    4. Save - Save the private key and click Finish. You have just created a public and private key pair.

  2. Deleting a Key Pair

    1. In Compute > Key Pairs, right-click a key pair. The right-click menu is displayed.

    2. Click Delete. The following message is displayed: “Are you sure you want to delete this key pair?”

      delete-key-pair

    3. Click Delete. The key pair which was selected is deleted.