github.com/Pankov404/juju@v0.0.0-20150703034450-be266991dceb/doc/storage-model.txt (about) 1 @startuml 2 3 hide circle 4 hide empty methods 5 hide empty fields 6 7 namespace juju.charm { 8 class StorageMetadata { 9 Name: string 10 Description : string 11 Kind : StorageKind 12 ReadOnly : bool 13 Shared : bool 14 Location: string 15 CountMin : int 16 CountMax : int 17 } 18 19 enum StorageKind { 20 block 21 filesystem 22 } 23 24 Charm "1" *-- "*" StorageMetadata : specifies > 25 } 26 27 namespace juju.juju.state <<Database>> { 28 class Volume { 29 Id : string 30 Life : Life 31 Pool : string 32 Info : VolumeInfo 33 Params : VolumeParams 34 } 35 36 class VolumeInfo { 37 VolumeId : string 38 Size : int 39 Detachable : bool 40 ExtendedAttrs : map[string]interface{} 41 } 42 43 class VolumeParams { 44 Size : int 45 } 46 47 class VolumeAttachment { 48 DeviceName : string 49 } 50 51 class Filesystem { 52 Id : string 53 Life : Life 54 Pool : string 55 Info : FilesystemInfo 56 Params : FilesystemParams 57 } 58 59 class FilesystemInfo { 60 FilesystemId : string 61 Size : int 62 Detachable : bool 63 ExtendedAttrs : map[string]interface{} 64 } 65 66 class FilesystemParams { 67 Size : int 68 Location : string 69 } 70 71 class FilesystemAttachment { 72 MountPoint : string 73 } 74 75 class BlockDevice { 76 DeviceName : string 77 HardwareId : string 78 Size : int 79 FilesystemType : string 80 } 81 82 class StorageConstraints { 83 StorageName : string 84 Size : int 85 Count : int 86 Pool : StoragePool 87 } 88 89 class StoragePool { 90 Name : string 91 StorageProvider : string 92 Attributes : map[string]string 93 } 94 95 class StorageInstance { 96 Id : string 97 Pool : StoragePool 98 Life : Life 99 } 100 101 class StorageAttachment { 102 Location : string 103 } 104 105 Machine "1" *-- "*" BlockDevice : > has 106 Machine "1" *-- "*" VolumeAttachment : has > 107 Machine "1" *-- "*" FilesystemAttachment : has > 108 109 Unit "1" *-- "*" StorageInstance : owns (non-shared) > 110 Unit "1" *-- "*" StorageAttachment : has 111 Unit "1" *-- "*" StorageConstraints : records > 112 113 Service "1" *-- "*" StorageInstance : owns (shared) > 114 Service "1" *-- "*" StorageConstraints : records > 115 Service "1" -- "1" juju.charm.Charm 116 117 StorageInstance --* StoragePool 118 StorageInstance "1" *-- "*" StorageAttachment : has > 119 Volume "1" *-- "0-1" StorageInstance : assigned > 120 Volume "1" *-- "*" VolumeAttachment 121 Volume "1" *-- "*" VolumeParams 122 Volume "1" *-- "*" VolumeInfo 123 Filesystem "1" *-- "0-1" StorageInstance : assigned to > 124 Filesystem "1" *-- "0-1" FilesystemAttachment : assigned to > 125 Filesystem "1" *-- "0-1" FilesystemParams 126 Filesystem "1" *-- "0-1" FilesystemInfo 127 128 note as N1 129 Non-shared storage instances 130 are owned by and managed by a 131 unit, shared storage instances 132 are owned by a service and managed 133 by a unit of that service with 134 with a lease. 135 end note 136 StorageInstance .. N1 137 138 note as N2 139 The machine agent will periodically list 140 block devices on the machine and publish 141 them to state. This gives us a mechanism 142 to determine when a volume is attached 143 and visible to a machine. Additioally, 144 users will later be able to create a 145 Volume from an unused BlockDevice, e.g. 146 hot-plugged disks in MAAS. 147 end note 148 BlockDevice .. N2 149 150 note as N3 151 Volumes and Filesystems will initially 152 be unprovisioned, and will have Params 153 documents associated. Once provisioned, 154 the Params are dropped and replaced with 155 Info. We don't currently, but may later 156 periodically update Info with, e.g. 157 currently available size. 158 end note 159 VolumeInfo .. N3 160 FilesystemInfo .. N3 161 VolumeParams .. N3 162 FilesystemParams .. N3 163 164 note as N4 165 StorageInstance represents a possibly 166 shared store, whereas a StorageAttachment 167 represents the storage instance's attachment 168 to a unit. For non-shared stores, there 169 will be a one-to-one relationship between 170 StorageInstance and StorageAttachment. 171 For shared stores, there may be multiple 172 units attached to a store, potentially with 173 different locations (e.g. block device paths, 174 filesystem mount points). 175 end note 176 StorageInstance .. N4 177 StorageAttachment .. N4 178 179 note as N5 180 Volumes and Filesystems may be multi-attachable, 181 hence we model attachment as well as the entity 182 itself. Each VolumeAttachment and 183 FilesystemAttachment may have different 184 machine-specific properties (e.g. device name, 185 filesystem mount point). 186 end note 187 Volume .. N5 188 VolumeAttachment .. N5 189 Filesystem .. N5 190 FilesystemAttachment .. N5 191 192 note as N6 193 Volumes and Filesystems may be persistent, and 194 so are not tied to a single storage instance 195 forever. For example, if we deploy a service 196 with persistent storage, and later destroy the 197 unit, we should later be able to reuse that 198 persistent storage with another unit to revive 199 the service. 200 end note 201 Volume .. N6 202 Filesystem .. N6 203 StorageInstance .. N6 204 } 205 206 namespace juju.names { 207 VolumeTag ..> juju.juju.state.Volume : identifies 208 FilesystemTag ..> juju.juju.state.Filesystem : identifies 209 StorageTag ..> juju.juju.state.StorageInstance : identifies 210 } 211 212 @enduml