4.1. add

4.1.1. add cluster

rocks add cluster {ip} {num-computes} [cluster-naming=bool] [container-hosts=string] [cpus-per-compute=string] [disk-per-compute=string] [disk-per-frontend=string] [fe-container=string] [fe-name=string] [ip=string] [mem-per-compute=string] [num-computes=string] [virt-type=string] [vlan=string]

Add a VM-based cluster to an existing physical cluster.

arguments

ip

The IP address for the virtual frontend.

num-computes

The number of compute nodes VMs to associate with the frontend.

parameters

[cluster-naming=bool]

If true it will name the compute nodes not based on the physical node they are allocated but based on the fe-name. If the frontend is called cluster the compute nodes will be named: vm-cluster-0 vm-cluster-1 vm-cluster-2 etc.

[container-hosts=string]

A list of VM container hosts that will be used to hold the VM compute nodes. This must be a space-separated list (e.g., container-hosts="vm-container-0-0 vm-container-0-1"). The default is to allocate the compute nodes in a round robin fashion across all the VM containers.

[cpus-per-compute=string]

The number of CPUs to allocate to each VM compute node. The default is 1.

[disk-per-compute=string]

The size of the disk (in gigabytes) to allocate to each VM compute node. The default is 36.

[disk-per-frontend=string]

The size of the disk (in gigabytes) to allocate to the VM frontend node. The default is 36.

[fe-container=string]

Hosting machine for virtual frontend. Defaults to the physical frontend

[fe-name=string]

name to for labeling the frontend. defaults to frontend-0-0-n, where n is assigned

[ip=string]

Can be used in place of the ip argument.

[mem-per-compute=string]

The amount of memory (in megabytes) to allocate to each VM compute node. The default is 1024.

[num-computes=string]

Can be used in place of the num-computes argument.

[virt-type=string]

Defines the virtualization type as either paravirtualized (para) or Hardware Virtualized (hvm). KVM supports only hvm if you try to specify something else it will abort.

[vlan=string]

The VLAN ID to assign to this cluster. All network communication between the nodes of the virtual cluster will be encapsulated within this VLAN. The default is the next free VLAN ID.

examples

# rocks add cluster 1.2.3.4 2

Create one frontend VM, assign it the IP address '1.2.3.4', and create 2 compute node VMs.

4.1.2. add host vm

rocks add host vm {host...} {membership} [cpus=string] [disk=string] [disksize=string] [ip=string] [mac=string] [mem=string] [membership=string] [name=string] [num-macs=string] [slice=string] [subnet=string] [sync-config=bool] [virt-type=string] [vlan=string]

Add a VM specification to the database.

arguments

host

One or more physical host names.

membership

The membership to assign to the VM.

parameters

[cpus=string]

The number of CPUs to assign to this VM. The default is: 1.

[disk=string]

A disk specification for this VM. The fist part of the disk is a string used to specify the format of the disk on the domain 0: file is used for raw file format, qcow2 for the qcow2 file fomat, and phy for a physical device The second part of the disk string is a path to the location of the disk on the system up to the first comma (,). The third part is used to indicate the name under which the disk is exposed to the guest OS. The actual device name specified is not guaranteed to map to the device name in the guest OS. Treat it as a device ordering hint. The forth part indicate the type of disk device to emulate valid values are "virtio" (default), "ide", "scsi". The default is: file:/<largest-partition-on-physical-node>/kvm/disks/<vm-name>.vda,vda,virtio

[disksize=string]

The amount of disk space in gigabytes to assign to the disk specification. The default is: 36.

[ip=string]

The IP address to assign to the VM. If no IP address is provided, then one will be automatically assigned.

[mac=string]

A MAC address to assign to this VM. If no MAC address is specified, the next free MAC address will be selected.

[mem=string]

The amount of memory in megabytes to assign to this VM. The default is: 2048.

[membership=string]

Can be used in place of the membership argument.

[name=string]

The name to assign to the VM (e.g., 'compute-0-0-0').

[num-macs=string]

The number of MAC addresses to automatically assign to this VM. The default is 1.

[slice=string]

The 'slice' id on the physical node. Each VM on a physical node has a unique slice number The default is the next available free slice number.

[subnet=string]

The subnet to associate to this VM. The default is: private.

[sync-config=bool]

Decides if 'rocks sync config' should be run after the VM is added. The default is: yes.

[virt-type=string]

Virtualization Type. With the kvm roll only hvm is a valid value.

[vlan=string]

The vlan ID to set for each interface. If you supply multiple MACs (e.g., 'num-macs' > 1), you can specify multiple vlan IDs by a comma separated list (e.g., vlan="3,4,5"). To not specify a vlan for a MAC, use the keyword 'none'. For example, if you want to specify a vlan ID for interface 1 and 3, but not interface 2, type: vlan="3,none,5". The default is to not assign a vlan ID.

examples

# rocks add host vm

Create a default VM.

# rocks add host vm mem=4096

Create a VM and allocate 4 GB of memory to it.