Commit 98517b23 authored by Jonathon Duerig's avatar Jonathon Duerig

Added disk image support to ptopgen and a set of 0.2 schema files which allow...

Added disk image support to ptopgen and a set of 0.2 schema files which allow disk images in the rspec..
parent 22ad4ed4
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.protogeni.net/resources/rspec/0.2" xmlns:rspec="http://www.protogeni.net/resources/rspec/0.2">
<xs:include schemaLocation="ad-top.xsd"/>
<!--
EMULAB-COPYRIGHT
Copyright (c) 2008 University of Utah and the Flux Group.
All rights reserved.
-->
<!--
Common definitions for advertisements, requests, and tickets
Version 0.2
-->
<xs:element name="node" type="rspec:NodeContents"/>
<xs:element name="link" type="rspec:LinkContents"/>
<xs:complexType name="NodeContents">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:element ref="rspec:subnode_of"/>
<xs:group ref="rspec:NodeTypeList"/>
<xs:element ref="rspec:interface"/>
</xs:choice>
<xs:choice>
<xs:element ref="rspec:location"/>
<xs:element ref="rspec:available"/>
<xs:element ref="rspec:exclusive"/>
<xs:element ref="rspec:cloud"/>
<xs:element ref="rspec:disk_image"/>
<xs:element ref="rspec:services"/>
</xs:choice>
</xs:choice>
<xs:attribute name="virtualization_type"/>
<xs:attributeGroup ref="rspec:ComponentName"/>
</xs:complexType>
<xs:element name="subnode_of" type="xs:string"/>
<xs:element name="interface" type="rspec:InterfaceDecl"/>
<xs:element name="available" type="xs:boolean"/>
<xs:element name="exclusive" type="xs:boolean"/>
<xs:element name="cloud">
<xs:complexType/>
</xs:element>
<xs:element name="disk_image">
<xs:complexType>
<xs:attributeGroup ref="rspec:DiskImageContents"/>
<xs:attribute name="default"/>
</xs:complexType>
</xs:element>
<xs:element name="services" type="rspec:ServiceContents"/>
<xs:complexType name="LinkContents">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:group ref="rspec:LinkType"/>
<xs:element ref="rspec:interface_ref"/>
</xs:choice>
<xs:choice>
<xs:element ref="rspec:bandwidth"/>
<xs:element ref="rspec:latency"/>
<xs:element ref="rspec:packet_loss"/>
</xs:choice>
</xs:choice>
<xs:attribute name="virtualization_type"/>
<xs:attributeGroup ref="rspec:ComponentName"/>
</xs:complexType>
<xs:element name="interface_ref">
<xs:complexType>
<xs:attributeGroup ref="rspec:InterfaceRef"/>
</xs:complexType>
</xs:element>
<xs:element name="bandwidth">
<xs:annotation>
<xs:documentation>Bandwidth of the link in kbps</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:float">
<xs:minExclusive value="0.0"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="latency">
<xs:annotation>
<xs:documentation>Latency of the link in ms</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:float">
<xs:minInclusive value="0.0"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="packet_loss">
<xs:simpleType>
<xs:restriction base="xs:float">
<xs:minInclusive value="0.0"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:group name="NodeTypeList">
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="rspec:node_type"/>
</xs:sequence>
</xs:group>
<xs:group name="LinkType">
<xs:sequence>
<xs:element name="link_type">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="rspec:field"/>
</xs:sequence>
<xs:attribute name="name"/>
<xs:attribute name="type_name"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:group>
<xs:element name="field">
<xs:complexType>
<xs:attribute name="key" use="required"/>
<xs:attribute name="value" use="required"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="VirtualName">
<xs:attribute name="virtual_id" use="required"/>
</xs:attributeGroup>
<xs:attributeGroup name="ComponentName">
<xs:attribute name="component_manager_uuid"/>
<xs:attribute name="component_manager_urn"/>
<xs:attribute name="component_name"/>
<xs:attribute name="component_uuid"/>
<xs:attribute name="component_urn"/>
</xs:attributeGroup>
<xs:attributeGroup name="ComponentInterfaceDeclName">
<xs:attribute name="component_id" use="required"/>
</xs:attributeGroup>
<xs:attributeGroup name="ComponentInterfaceRefName">
<xs:attribute name="component_node_uuid"/>
<xs:attribute name="component_node_urn"/>
<xs:attribute name="component_interface_id" use="required"/>
</xs:attributeGroup>
<xs:complexType name="InterfaceDecl">
<xs:sequence>
<xs:element minOccurs="0" ref="rspec:monitoring"/>
</xs:sequence>
<xs:attributeGroup ref="rspec:ComponentInterfaceDeclName"/>
<xs:attribute name="role">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="control"/>
<xs:enumeration value="experimental"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="public_ipv4"/>
</xs:complexType>
<xs:element name="monitoring">
<xs:complexType>
<xs:attribute name="user_traffic"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="InterfaceRef">
<xs:attributeGroup ref="rspec:ComponentInterfaceRefName"/>
</xs:attributeGroup>
<xs:element name="location">
<xs:complexType>
<xs:attribute name="country" use="required"/>
<xs:attribute name="longitude"/>
<xs:attribute name="latitude"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="DiskImageContents">
<xs:attribute name="name" use="required"/>
<xs:attribute name="os"/>
<xs:attribute name="version"/>
<xs:attribute name="description"/>
</xs:attributeGroup>
<xs:element name="rspec" type="rspec:RSpecContents"/>
<xs:complexType name="RSpecContents">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:element ref="rspec:node"/>
<xs:element ref="rspec:link"/>
</xs:choice>
<xs:choice>
<xs:element ref="rspec:external_ref"/>
<xs:element ref="rspec:bgp_prefix"/>
</xs:choice>
</xs:choice>
<xs:attribute name="generated" type="xs:dateTime"/>
<xs:attribute name="generated_by"/>
<xs:attribute name="valid_until" type="xs:dateTime"/>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="advertisement"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.protogeni.net/resources/rspec/0.2" xmlns:rspec="http://www.protogeni.net/resources/rspec/0.2">
<!--
EMULAB-COPYRIGHT
Copyright (c) 2005-2007 University of Utah and the Flux Group.
All rights reserved.
-->
<!--
Definition of common data structures used for representing topologies -
shared between vtop (virtual topology) and ptop (physical topology)
formats.
Version 0.1
-->
<xs:element name="node_type">
<xs:complexType>
<xs:complexContent>
<xs:extension base="rspec:NodeTypeContents">
<xs:attribute name="type_name" use="required">
<xs:annotation>
<xs:documentation>Name of the type - will almost certainly not be unique</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="type_slots" use="required">
<xs:simpleType>
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="unlimited"/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="static">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:complexType name="NodeTypeContents">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="rspec:field"/>
</xs:sequence>
</xs:complexType>
<xs:group name="LinkTypeSpec">
<xs:sequence>
<xs:element name="link_type">
<xs:complexType>
<xs:attribute name="type_name" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:group>
<xs:group name="LinkEndPoints">
<xs:sequence>
<xs:element ref="rspec:source_interface"/>
<xs:element ref="rspec:destination_interface"/>
</xs:sequence>
</xs:group>
<xs:element name="source_interface" type="rspec:InterfaceSpec">
<xs:annotation>
<xs:documentation>First interface for this link</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="destination_interface" type="rspec:InterfaceSpec">
<xs:annotation>
<xs:documentation>Second interface for this link</xs:documentation>
</xs:annotation>
</xs:element>
<xs:group name="LinkCharacteristics">
<xs:sequence>
<xs:element ref="rspec:bandwidth"/>
<xs:element ref="rspec:latency"/>
<xs:element ref="rspec:packet_loss"/>
</xs:sequence>
</xs:group>
<xs:element name="fd">
<xs:complexType>
<xs:attribute name="fd_name" use="required"/>
<xs:attribute name="fd_weight" use="required"/>
<xs:attribute name="violatable">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="global_operator">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="OnceOnly"/>
<xs:enumeration value="FirstFree"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="local_operator">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="+"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="GlobalSpec">
<xs:attribute name="global_operator" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="OnceOnly"/>
<xs:enumeration value="FirstFree"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
<xs:attributeGroup name="LocalSpec">
<xs:attribute name="local_operator" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="+"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
<xs:complexType name="InterfaceSpec">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="rspec:property"/>
</xs:sequence>
<xs:attribute name="node_name" use="required"/>
<xs:attribute name="interface_name" use="required"/>
<xs:attribute name="physical_node_name"/>
<xs:attribute name="physical_interface_name"/>
</xs:complexType>
<xs:group name="InterfaceContents">
<xs:sequence>
<xs:element ref="rspec:node_name"/>
<xs:element ref="rspec:interface_name"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="rspec:property">
<xs:annotation>
<xs:documentation>Properties of the interface</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:group>
<xs:element name="node_name" type="xs:string">
<xs:annotation>
<xs:documentation>Name of the node, which must match one of the nodes in this topology</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="interface_name" type="xs:string">
<xs:annotation>
<xs:documentation>Name of the interface itself</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="property">
<xs:complexType>
<xs:sequence>
<xs:element ref="rspec:property_name"/>
<xs:element ref="rspec:property_value"/>
<xs:element ref="rspec:property_penalty"/>
<xs:element minOccurs="0" ref="rspec:violatable"/>
</xs:sequence>
<xs:attribute name="global_operator">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="OnceOnly"/>
<xs:enumeration value="FirstFree"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="local_operator">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="+"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="property_name" type="xs:string">
<xs:annotation>
<xs:documentation>Name of this property</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="property_value" type="xs:string"/>
<xs:element name="property_penalty">
<xs:annotation>
<xs:documentation>The penalty associated with this property</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:float">
<xs:minInclusive value="0.0"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="violatable">
<xs:annotation>
<xs:documentation>If this flag is present, not having the property is considered a violation</xs:documentation>
</xs:annotation>
<xs:complexType/>
</xs:element>
</xs:schema>
#
# EMULAB-COPYRIGHT
# Copyright (c) 2008-2009 University of Utah and the Flux Group.
# Copyright (c) 2008 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -15,69 +15,62 @@ include "common.rnc"
NodeContents &=
# Component identifiers
attribute component_id { text } &
attribute component_manager_id { text } &
attribute component_name { text }? &
# Indicates whether the node is in sharing mode: exclusive is true if
# the component manager will agree to promise not to share it.
attribute exclusive { xsd:boolean } &
ComponentName &
# Information about the physical location of the node.
Location? &
# Indicate whether or not this node is available - the idea is that a
# full dump of the static physical topology will not include this, but
# that we can later get updates that include only this attribute (and a
# URN)
element available { AvailableContents } &
# UUID) Just binary for now - probably will include more things, such
# as a number of "free slots", later
element available { xsd:boolean } &
# Indicates whether the node is in sharing mode: exclusive is true if
# the component manager will agree to promise not to share it.
element exclusive { xsd:boolean } &
# Marks this node as a stand-in for a large network rather than a
# single machine. This means that other CMs can make external
# references to this node without a corresponding external reference
# in this advertisement. It also means that it makes sense for
# multiple physical links to connect to the same interface.
element cloud { AnyExtension } &
element cloud { empty } &
# Lists services provided by the CM for this node.
element services { ServiceContents } &
# Node type. This includes both hardware and software elements:
HardwareType* &
SoftwareType*
element disk_image {
DiskImageContents &
# Defaults to false
attribute default { text }?
}* &
AvailableContents =
AnyExtension &
# Indictates current availability
attribute now { xsd:boolean }
# Lists services provided by the CM for this node.
element services { ServiceContents }
LinkContents &=
# Component identifiers
attribute component_id { text } &
attribute component_manager_id { text } &
attribute component_name { text }?
InterfaceContents &=
attribute component_id { text } &
attribute component_name { text }? &
element monitoring { MonitoringContents }? &
attribute role { "control" | "experimental" | "mixed" }? &
ComponentName &
# Characteristics (bandwidth, latency, loss) which affect traffic.
LinkCharacteristics?
InterfaceDecl &=
ComponentInterfaceDeclName &
element monitoring { attribute user_traffic { text }? }? &
attribute role { "control" | "experimental" }? &
attribute public_ipv4 { text }?
MonitoringContents &=
AnyExtension &
# True if user traffic moves through this interface and is available
# for monitoring.
attribute user_traffic { xsd:boolean }?
InterfaceRefContents &=
attribute component_id { text }
InterfaceRef &=
ComponentInterfaceRefName
# Reference to components managed by other component managers.
ExternalReferenceContents &=
AnyExtension &
attribute component_id { text } &
attribute component_manager_id { text }?
# TODO: Merge ComponentInterfaceRefName into just component_id when
# length restrictions on URNs end.
ExternalReference = element external_ref {
ComponentInterfaceRefName &
attribute component_manager_uuid { text }? &
attribute component_manager_urn { text }?
}
ServiceContents &=
AnyExtension &
# Login services include ssh-services, serial consoles, etc.
element login { LoginServiceContents }* &
......@@ -89,7 +82,6 @@ ServiceContents &=
element execute { ExecuteServiceContents }*
LoginServiceContents &=
AnyExtension &
# Authentication mechanism
attribute authentication { "ssh-keys" } &
# Access mechanism
......@@ -97,19 +89,21 @@ LoginServiceContents &=
attribute port { text }
InstallServiceContents &=
AnyExtension &
# Type(s) of archives supported
attribute file_type { "tar.gz" | "tar.bz2" }
ExecuteServiceContents &=
AnyExtension &
# Shell environment allowed
attribute shell { "sh" }
RSpecContents &=
attribute type { "advertisement" } &
element external_ref {
ExternalReferenceContents
}*
ExternalReference* &
BgpPrefix*
BgpPrefix = element bgp_prefix {
attribute address { text } &
attribute netmask { text }
}
start = RSpec
<?xml version="1.0" encoding="UTF-8"?>
<!--
EMULAB-COPYRIGHT
Copyright (c) 2008 University of Utah and the Flux Group.
All rights reserved.
-->
<!--
Prototype of an advertisement RSpec, to be used by ProtoGENI
Version 0.2
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.protogeni.net/resources/rspec/0.2" xmlns:rspec="http://www.protogeni.net/resources/rspec/0.2">
<xs:include schemaLocation="ad-common.xsd"/>
<!--
Reference to components managed by other component managers.
TODO: Merge ComponentInterfaceRefName into just component_id when
length restrictions on URNs end.
-->
<xs:element name="external_ref">
<xs:complexType>
<xs:attributeGroup ref="rspec:ComponentInterfaceRefName"/>
<xs:attribute name="component_manager_uuid"/>
<xs:attribute name="component_manager_urn"/>
</xs:complexType>
</xs:element>
<xs:complexType name="ServiceContents">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="rspec:login"/>
<xs:element ref="rspec:install"/>
<xs:element ref="rspec:execute"/>
</xs:choice>
</xs:complexType>
<xs:element name="login">
<xs:complexType>
<xs:attributeGroup ref="rspec:LoginServiceContents"/>
</xs:complexType>
</xs:element>
<xs:element name="install">
<xs:complexType>
<xs:attributeGroup ref="rspec:InstallServiceContents"/>
</xs:complexType>
</xs:element>
<xs:element name="execute">
<xs:complexType>
<xs:attributeGroup ref="rspec:ExecuteServiceContents"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="LoginServiceContents">
<xs:attribute name="authentication" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="ssh-keys"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="hostname" use="required"/>
<xs:attribute name="port" use="required"/>
</xs:attributeGroup>
<xs:attributeGroup name="InstallServiceContents">
<xs:attribute name="file_type" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="tar.gz"/>
<xs:enumeration value="tar.bz2"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
<xs:attributeGroup name="ExecuteServiceContents">
<xs:attribute name="shell" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="sh"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
<xs:element name="bgp_prefix">
<xs:complexType>
<xs:attribute name="address" use="required"/>
<xs:attribute name="netmask" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>
#
# EMULAB-COPYRIGHT
# Copyright (c) 2008-2009 University of Utah and the Flux Group.
# Copyright (c) 2008 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -9,121 +9,117 @@
# Version 0.2
#
default namespace = "http://www.protogeni.net/resources/rspec/0.2"
include "top.rnc"
include "any-extension.rnc"
NodeSpec = element node { NodeContents }
RSpec = element rspec {
RSpecContents
}
RSpecContents =
AnyExtension &
# When this RSpec was generated - optional, can be used for determining
# staleness
attribute generated { xsd:dateTime }? &
# Who/what generated the rspec. This is purely informative and
# should not be used for any policy consideration. The format is
# not fixed.
attribute generated_by { text }? &
# How long this rspec is valid - in the case of a ticket, this indicates
# how long the holder may use the resources. For a resource request, it's
# how long we want the resources. For an advertisement, it might be a hint
# as to how long it's okay to cache this rspec.
attribute valid_until { xsd:dateTime }? &
# One or more nodes/links
Node* &
Link*
Node = element node { NodeContents }
Link = element link { LinkContents }
LinkSpec = element link { LinkContents }
NodeContents =
AnyExtension &
# A relation indicates that this node has a relationship with
# another node. It may be hosted on that node, share important
# resources, etc.
element relation { RelationContents }* &
# Each node has exactly one virtualization technology, which we simply
# enumerate here
attribute virtualization_type { text }? &
# Each node may be the subnode of (physically located within) another.
# In advertisements, this is the URN of the other component.
# In requests, this is the virtual_id of the other sliver.
# TODO: To be consistent with the rest of the RSpec, we should have
# an attribute called parent_node instead of a child text node
element subnode_of { text }? &
# Information about the nodes physical location
element location { LocationContents } &
# Node type list
NodeTypeList &
# List of interfaces on this node. Interfaces are declared here. So
# all information about a particular interface including types
# belongs in the declaration. Other references to interfaces
# should just uniquely identify them and refer back here.
element interface {
InterfaceContents
InterfaceDecl
}*
RelationContents =
AnyExtension
LinkContents =
# Each link has exactly one virtualization technology, which we simply
# enumerate here
attribute virtualization_type { text }? &
# Link types
LinkType+ &
# The interfaces which this link spans.
element interface_ref {
InterfaceRef
}*
LocationContents =
AnyExtension &
# The two-letter ISO 3166 code for the country the node is in.
attribute country { text } &
# Longitude and Latitude coordinates of the node using the
# WGS 84 standard.
attribute longitude { text }? &
attribute latitude { text }?
NodeTypeList = NodeTypeSpec+
InterfaceContents = AnyExtension
NodeTypeContents &= TypeField*