Jump to: navigation, search

Difference between revisions of "BlockDeviceConfig"

Line 46: Line 46:
  
 
Given the extra features to be supported, it is desirable to introduce a new syntax for 'nova boot' and friends which is more expressive
 
Given the extra features to be supported, it is desirable to introduce a new syntax for 'nova boot' and friends which is more expressive
 
Key off the device type:
 
 
* -cdrom type=glance,id=XXXXXXXXX,bus=ide,bootindex=2
 
* -disk type=cinder,id=XXXXXXXXX,bus=ide,bootindex=1
 
* -mmc type=ephemeral,format=swap,size=50,dev=/dev/sda
 
 
Or a totally generic arg:
 
  
 
* -block type=glance,id=XXXXXXX,bus=ide,bootindex=2
 
* -block type=glance,id=XXXXXXX,bus=ide,bootindex=2
Line 60: Line 52:
  
 
The only compulsory argument ought to be the type + id, eg the glance or cinder ID. Everything else should have sane defaults filled in by the hypervisor driver in Nova.
 
The only compulsory argument ought to be the type + id, eg the glance or cinder ID. Everything else should have sane defaults filled in by the hypervisor driver in Nova.
 +
 +
Possible parameters would be
 +
 +
* type=glance|cinder|ephemeral
 +
* id=XXXXXX (a volume/image UUID if using type=glance or type=cinder)
 +
* format=swap|ext4|...|none (to format the image/volume/ephemeral file; defaults to 'none' if omitted)
 +
* bus=ide|usb|virtio|scsi (hypervisor driver chooses a suitable default if omitted)
 +
* device=disk|cdrom|floppy|mmc (defaults to 'disk' if omitted)
 +
* bootindex=N  (where N is any number >= 0, controls the order in which disks are looked at for booting)
 +
* size=NN (where NN is number of GB to create type=emphemeral image, or the size to re-size to for type=glance|cinder)
 +
* shutdown=preserve|remove (where the default is remove for type=glance|ephemeral or preserve for type=cinder)
  
 
== Data Format for Nova Compute APIs ==
 
== Data Format for Nova Compute APIs ==
 
TBD
 
TBD

Revision as of 14:14, 29 January 2013

Block Device Configuration

Controls for block device configuration

There are a variety of independent attributes that it is desirable to control when configuring block devices for a virtual machine in OpenStack

Source type

  • Glance image
  • Cinder volume
  • Ephemeral file

Guest format

  • ext4 (or other FS formats)
  • ISO
  • Swap (different format per guest OS)
  • None

Device type

  • Disk
  • CDROM
  • Floppy
  • Flash (MMC)

Disk bus

  • USB
  • IDE
  • VirtIO
  • SCSI

Shutdown action

  • Delete
  • Preserve

Boot order

  • Index

In addition to the above parameters, it is neccesary to support a "disk path" parameter, to allow the user to request a specific block device path in the guest eg /dev/sda. In general this cannot be supported by all hypervisors and thus its usage should be discouraged in favour of allowing the guest OS / hypervisor to choose paths. For the sake of compatibility with existing tools / APIs though, it must be supported

Command line syntax for block config

The 'nova boot' command currently uses a combination of the '-image' and '-block-device-mapping' command line args to configure storage. The latter is mostly a clone of the same named arg from the EC2 commands, and is not a very well designed syntax from the POV of extensibility.

Given the extra features to be supported, it is desirable to introduce a new syntax for 'nova boot' and friends which is more expressive

  • -block type=glance,id=XXXXXXX,bus=ide,bootindex=2
  • -block type=cinder,id=XXXXXXX,bus=ide,device=cdrom,bootdex=1
  • -block type=ephemeral,format=swap,size=50,bus=ide,device=floppy

The only compulsory argument ought to be the type + id, eg the glance or cinder ID. Everything else should have sane defaults filled in by the hypervisor driver in Nova.

Possible parameters would be

  • type=glance|cinder|ephemeral
  • id=XXXXXX (a volume/image UUID if using type=glance or type=cinder)
  • format=swap|ext4|...|none (to format the image/volume/ephemeral file; defaults to 'none' if omitted)
  • bus=ide|usb|virtio|scsi (hypervisor driver chooses a suitable default if omitted)
  • device=disk|cdrom|floppy|mmc (defaults to 'disk' if omitted)
  • bootindex=N (where N is any number >= 0, controls the order in which disks are looked at for booting)
  • size=NN (where NN is number of GB to create type=emphemeral image, or the size to re-size to for type=glance|cinder)
  • shutdown=preserve|remove (where the default is remove for type=glance|ephemeral or preserve for type=cinder)

Data Format for Nova Compute APIs

TBD