Resources description
Distem resources description
Instructions
In this file [r/w], specify if a resource is readable and/or writable when accessing it throught the Network API (REST).
Hashes are described with ruby structure.
If a resource name is specified between [] that mean that its a table of this resource type. Sample: [cores].
Physical Node
Type: Hash
Structure overview:
- id [r]: The unique id of this physical machine.
- address [r]: The ip address of the physical node.
- status [r]: The current status of this resource.
-
algorithms: The algorithm that are currently in use to apply the different limitation on physical resources.
- cpu
-
memory: The description of the physical memory of this machine.
- capacity
- swap
-
cpu: The descriptio of the CPU of this machine.
- id
- [cores]
- physicalid
- coreid
- frequency
- frequencies
- cache_links
- [cores_alloc]
- [critical_cache_links]
max_vifaces: The maximum number of virtual network interfaces that shoud be created on this physical node.
Sample:
{
"address"=>"172.16.65.80",
"memory"=>{"capacity"=>"16086 Mo", "swap"=>"3820 Mo"},
"id"=>"0",
"algorithms"=>{"cpu"=>"hogs"},
"cpu"=>
{"cores"=>
[{"physicalid"=>"5",
"frequencies"=>["2000 MHz", "2500 MHz"],
"coreid"=>"6",
"frequency"=>"2500 MHz",
"cache_links"=>["7"]},
{"physicalid"=>"0",
"frequencies"=>["2000 MHz", "2500 MHz"],
"coreid"=>"0",
"frequency"=>"2500 MHz",
"cache_links"=>["2"]},
{"physicalid"=>"6",
"frequencies"=>["2000 MHz", "2500 MHz"],
"coreid"=>"3",
"frequency"=>"2500 MHz",
"cache_links"=>["4"]},
...
],
"cores_alloc"=>
[{"vnode"=>"node2", "core"=>"5"},
{"vnode"=>"node2", "core"=>"0"},
{"vnode"=>"node2", "core"=>"6"}],
"id"=>"69972201354320",
"critical_cache_links"=>[["0", "2"], ["4", "6"], ["1", "3"], ["5", "7"]]},
"status"=>"RUNNING"
}
Status
Availability: Read / Write
Type: String
Values:
- CONFIGURING [r]: The machine is currently being configured
- RUNNING [r/w]: The physical machine is running
Algoritms
Type: Hash
Structure overview:
- cpu [r/w]: The algorithm to be used for CPU emulation (limitations). Values: Hogs, Gov.
Sample:
{
"cpu"=>"hogs"
}
Memory
Type: Hash
Structure overview:
- capacity [r]: The amount of physical memory this machine is owning.
- swap [r]: The amount of swap memory this machine is owning.
Sample:
{
"capacity"=>"16086 Mo",
"swap"=>"3820 Mo"
}
CPU
Type: Hash
Structure overview:
- id [r]: The unique id of this physical CPU.
-
cores_alloc [r]: Array of Hashes. Hashes are describing the association between a virtual node -vnode- and a physical core -core-.
- vnode
- core
- critical_cache_links [r]: Array of Arrays. On some CPUs a core cannot change his frequency independently from other cores. Each Array is describing the link between cores (i.e. the ones that should change their frequencies together). Core are specified by physicalid.
- [cores]: The cores of this CPU.
- physicalid
- coreid
- frequency
- frequencies
- cache_links
Sample:
{
"id"=>"69972201354320",
"cores"=>[
{
"physicalid"=>"5",
"frequencies"=>["2000 MHz", "2500 MHz"],
"coreid"=>"6",
"frequency"=>"2500 MHz",
"cache_links"=>["7"]
},
{
"physicalid"=>"0",
"frequencies"=>["2000 MHz", "2500 MHz"],
"coreid"=>"0",
"frequency"=>"2500 MHz",
"cache_links"=>["2"]
},
{
"physicalid"=>"6",
"frequencies"=>["2000 MHz", "2500 MHz"],
"coreid"=>"3",
"frequency"=>"2500 MHz",
"cache_links"=>["4"]
},
...
],
"cores_alloc"=>[
{"vnode"=>"node2", "core"=>"5"},
{"vnode"=>"node2", "core"=>"0"},
{"vnode"=>"node2", "core"=>"6"}
],
"critical_cache_links"=>[
["0", "2"],
["4", "6"],
["1", "3"],
["5", "7"]
]
}
Core
Type: Hash
Structure overview:
- physicalid [r]: The physical id of this core as specified by hwloc
- coreid [r]: The core id of this core as specified by hwloc
- frequency [r]: The current frequency this core is set to work on
- frequencies [r]: The available frequencies this core is able to use
- cache_links [r]: On some CPUs a core cannot change his frequency independently from other cores. This Array is describing the link between this core and other ones (i.e. the ones that should change their frequencies with this core). Core are specified by physicalid.
Sample:
{
"physicalid"=>"5",
"frequencies"=>["2000 MHz", "2500 MHz"],
"coreid"=>"6",
"frequency"=>"2500 MHz",
"cache_links"=>["7"]
}
Virtual Node
Type: Hash
Structure overview:
- host [r/w]: The address of the physical node the virtual node should be created on.
- gateway [r/w]: Gateway or normal mode. Values: true,false.
- ssh_key: The SSH key pair to be used on this virtual node
- status [r/w]: The current status of this virtual node
-
vcpu: The virtual CPU of this virtual node
- [vcores]
- pcore
- frequency
- pcpu
- [vcores]
-
vfilesystem: The virtual filesystem of this virtual node
- shared
- path
- sharedpath
- image
- [vifaces]: The different virtual network interfaces of this virtual node
Sample:
{
"name"=>"node1",
"status"=>"RUNNING",
"gateway"=>false,
"host"=>"192.168.0.1",
"vfilesystem"=>{
"sharedpath"=>nil,
"shared"=>false,
"path"=>"/tmp/distem/rootfs-unique/node1",
"image"=>"file:///home/lsarzyniec/rootfs.tar.gz"
},
"ssh_key"=>{"public"=>"ssh-rsa AAAs4f5G...sD3gFf", "private"=>"M1HdH32F...sOA4s"},
"vifaces"=>[
{
"name"=>"if0",
"address"=>"10.144.2.1/24",
"vnetwork"=>"network1",
"output"=>{
"bandwidth"=>{"rate" => "100mbps"},
"latency"=>{"delay" => "2ms"}
},
"input"=>{
"bandwidth"=>{"rate" => "20mbps"},
"latency"=>{"delay" => "5ms"}
}
}
],
"vcpu"=>{
"vcores"=>[
{"id"=>"0", "pcore"=>"5", "frequency"=>"1000 MHz"},
{"id"=>"1", "pcore"=>"0", "frequency"=>"1000 MHz"},
{"id"=>"2", "pcore"=>"6", "frequency"=>"1000 MHz"},
{"id"=>"3", "pcore"=>"1", "frequency"=>"1000 MHz"}
],
"pcpu"=>"69972201094900"
}
}
Status
Availability: Read / Write
Type: String
Values:
- INIT [r]: This virtual node is currently being described and was never started
- CONFIGURING [r]: This virtual node is currently being configured
- READY [r/w]: The virtual node is ready to be runned but not running.
- RUNNING [r/w]: The virtual node is running.
When starting a virtual node (going from state READY to RUNNING), a physical node (that have enought physical resources (CPU,...)) will be automatically allocated if there is none set as host at the moment. A filesystem image must have been set. The filesystem will be copied on the host physical node.
When stopping a virtual node (going from state RUNNING to READY), deleting its data from the hosting physical node. The host association for this virtual node will be cancelled, if you start the virtual node directcly after stopping it, the hosting physical node will be chosen randomly (to set it manually, see host field in VNode description).
SSH Key Pair
Availability: Read / Write
Type: Hash
Description: SSH key pair to be copied on the virtual node (also adding the public key to .ssh/authorized_keys). Note that every SSH keys located on the physical node which hosts this virtual node are also copied in .ssh/ directory of the node (copied key have a specific filename prefix). The key are copied in .ssh/ directory of SSH user (see Distem::Daemon::Admin::SSH_USER and Distem::Node::Container::SSH_KEY_FILENAME). Both of public and private parameters are optional
Structure overview:
- public [r/w]: String that describes the ssh public key that should be used by the virtual node (with the ssh-rsa or ssh-dsa prefix).
- private [r/w]: String that describes the ssh private key that should be used by the virtual node.
Sample: { "public"=>"ssh-rsa AAAs4f5G...sD3gFf", "private"=>"M1HdH32F...sOA4s" }
CPU
Type: Hash
Structure overview:
- [cores]: The virtual cores of this virtual cpu
- pcore
- frequency
- pcpu [r]: The physical CPU associated to this virtual one
This parameters are also taken in account:
- corenb The number of cores to allocate (need to have enough free ones on the physical node)
- frequency The frequency each node have to be set (need to be lesser or equal than the physical core frequency). If the frequency is included in ]0,1] itll be interpreted as a percentage of the physical core frequency, otherwise the frequency will be set to the specified number
Sample: { "vcores"=>[ "pcore"=>"5", "frequency"=>"1000 MHz", "pcore"=>"0", "frequency"=>"1000 MHz", "pcore"=>"6", "frequency"=>"1000 MHz", "pcore"=>"1", "frequency"=>"1000 MHz" ], "pcpu"=>"69972201094900" }
Core
Type: Hash
Structure overview:
- pcore [r]: the physical core (physicalid) associated to this virtual resource.
- frequency [r]: The frequency each node have to be set (need to be lesser or equal than the physical core frequency). If the frequency is included in ]0,1] itll be interpreted as a percentage of the physical core frequency, otherwise the frequency will be set to the specified number
Sample: { "pcore"=>"1", "frequency"=>"1000 MHz" }
File System
Type: Hash
Structure overview:
- image [r/w]: The URI to a compressed archive that should contain the virtual node file system.
- shared [r/w]: Share the file system of this virtual node with every other virtual node that have this property (local to the physical node). Values: true,false.
- path [r]: The path to the unique directory used to store this virtual node files
- sharedpath [r]: The path to the shared directory used to store this virtual node shared files
Sample:
{
"sharedpath"=>"/tmp/distem/rootfs-shared/rootfs.tar.gz-1315906532-...",
"shared"=>true,
"path"=>"/tmp/distem/rootfs-unique/nodegw",
"image"=>"file:///home/lsarzyniec/rootfs.tar.gz"
}
Network interface
Type: Hash
Structure overview:
- name [r]: The name of this virtual network interface
- vnetwork [r/w]: The virtual network (name) this virtual interface is connected to
- address [r/w]: The ip address of this virtual network interface
-
input: The description of the input traffic
- bandwidth
- latency
-
output: The description of the output traffic
- bandwidth
- latency
Sample: { "name"=>"if0", "address"=>"10.144.2.1/24", "vnetwork"=>"network1", "output"=>{ "bandwidth"=>=> "100mbps", "latency"=>=> "2ms" }, "input"=>{ "bandwidth"=>=> "20mbps", "latency"=>=> "5ms" } }
Traffic
Type: Hash
Structure overview:
-
bandwidth [r/w]: The bandwidth description
- rate [r/w]: The speed of the connection (linux/tc units, see man tc)
-
latency [r/w]: The latency description
- delay [r/w]: The delay of the connection (linux/tc units, see man tc)
Sample: { "bandwidth"=>=> "20mbps", "latency"=>=> "5ms" }