Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Wiki Markup
The Jira issue associated with this design spec is CLOUDSTACK-1043 \[1\]

Branch

TBDThe work is being carried out in branch standalone-nic, staged in a Github repository
https://github.com/siwater/incubator-cloudstack.

Introduction

Wiki Markup
This design proposes to expose a virtual network interface card (NIC) as a first class object in the CloudStack API. The pattern follows that of the Amazon Elastic Network Interface \[2\].

...

Wiki Markup
In CloudStack 4.0 release a virtual NIC is implicitly created when a virtual machine is deployed and connected to a network. Subsequent API changes \[3\] arehave been proposedmade forin the 4.1 release to allow a NIC to be added/removed from a virtual machine after creation.

...

  1. JIRA Issue CLOUDSTACK-1043
  2. Amazon Elastic Network Interface
  3. Add/Remove Network to VM

Document History

Glossary

Feature Specifications

...

The internal architecture of CloudStack already has much of the plumbing in place to support the proposed API changes.This section will be updated with Architecture and Design description as the required changes are identified.

The following is a high level commentary on the changes made:

Database Schema

The nics table is extended to add account/domain information.
A new view entitled nics_view is introduced to support the listNics command.

cloud-api

The following API command classes have been introduced in the org.apache.cloudstack.api.command.user.nic namespace:

  • CreateNicCmd
  • AttachNicCmd
  • DetachNicCmd
  • DeleteNicCmd
  • ListNicsCmd

Extend NetworkService API to allow create/delete Nic

Extend UserVmService API to allow attach/detach of Nic from VM.

Extend QueryService API to allow search for Nics.

cloud-server

Introduce NicsJoinDao and NicsJoinVO classes to support query functions

Implement create/delete Nic methods in NetworkServiceImpl

Implement attach/detach methods i nUserVmManagerImpl

Implement search for Nics method in QueryManagerImpl

Add methods in VirtualMachineManager API to attach/detach Nic from VM and provide implementation in VirtualMachineManagerImpl (partially by restructure of existing code)

Change NetworkManager API profile of assignPubliIpAddress to take an Account object to represent the owner rather than a VM object. Involved minor changes to Network Gurus.

Web Services APIs

The principle is that any changes to the existing API are required to be backward compatible – i.e. they should not break any existing clients of the API. For all commands standard access rights checks will be used to ensure the caller has the right to perform the operation.

...

Parameter Name

Description

Required

networkid

The Id of the network that the NIC will be attached to

true

securitygroupids

Comma separated list of security group ids to be associated with the NIC

false

ipaddress

Primary IP address of the NIC. If not specified a primary IP address will be automatically be allocated from the network range

false

secondaryipaddresses

Comma separated list of secondary IP addresses to be associated with the NIC. Cannot be used in conjunction with secondaryipaddresscount parameter

false

secondaryipaddresscount

Number of secondary IP addresses required on the NIC. The addresses will be automatically allocated from the network range. Cannot be used in conjunction with secondaryipaddresses parameter

false

ip6address

Primary IPv6 address of the NIC.

false

account

The account owning the NIC

false

domainid

The id of the domain in which the NIC should reside. If account is used, domainid must also be used.

false

projectid

The project in which to deploy the NIC

false

...

This command is modified to take an optional extra parameter that allows the caller to specify a collection of NICs to attach to the virtual machine. This parameter cannot be used with any of the legacy mechanisms for attaching a virtual machine to a network. In addition, if the the caller does specify a collection of NICs then she s/he may not also specify security groups for the virtual machine.

...

Attribute

Description

id

Id of the NIC

securitygroup(*)

List of security groups associated with the NIC

broadcasturi

URI

networkid

Id of the network to which NIC is connected

networkname

Name of the NIC network

instanceid

Id of the virtual machine to which NIC is attached

netmask

IPv4 netmask

gateway

IPv4 gateway

gateway

string

ipaddress

Primary IP IPv4 address of the NIC

isolationuri

Isolation URI

broadcasturi

Broadcast URI

traffictype

Traffic type

type

Type of

secondaryipaddress(*)

List of secondary IP addresses for the NIC

isdefault

Indicates if this the default NIC

isolationuri

URI

macaddress

string

netmask

string

networkid

string

traffictype

string

macaddress

MAC address of the NIC

ip6gateway

Address of IPv6 gateway

ip6address

Primary IPv6 address of the NIC

ip6cidr

IPv6 address CIDR of the NIC

securitygroup(*)

List of security groups associated with the NIC

secondaryipaddress(*)

List of secondary IP addresses for the NIC

type

string

UI flow

TBD

Appendix

Appendix A:

...