vVolume
The class "vVolume" is implemented to resemble a volume that can be attached to a container in Docker or Kubernetes which consumes the ROM from "vHost". A "vContainer" could be attached with multiple "vVolume" and those "vVolume" could be allocated on different "vHost" rather than the "vHost" where the "vContainer" is hosted. A "vVolume" could be persistent by setting attribute "retain" equals to true. If a "vVolume" is persistent, it will not be destoried when its associated "vContainer" is terminated and could be reattached to a new instance of the "vContainer". The "vVolume" must be allocated first before a "vContainer" is scheduled. If any "vVolume" is failed to be allocated onto "vHost", the schedule of its associated "vContainer" will be on hold.
Bases: VirtualEntity
Source code in PyCloudSim\entity\v_volume.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
|
allocated: bool
property
Check if the vVolume is allocated on a vHost.
attached: bool
property
Check if the vVolume is attached to a vContainer.
container: vContainer
property
The vContainer that the vVolume is attached to.
container_id: int
property
The id of the vContainer that the vVolume is attached to.
host: vHost
property
The vHost that the vVolume is allocated on.
host_id: int
property
The id of the vHost that the vVolume is allocated on.
path: str
property
The path of the vVolume.
retain: bool
property
Return true if the vVolume is retained.
size: Union[int, float]
property
The size of the vVolume in MiB.
tag: str
property
The tag of the vVolume.
taint: str
property
The taint of the vVolume.
__init__(tag=None, path=None, size=100, retain=False, taint=None, at=simulation.now, after=None, label=None)
Create a vVolume.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tag |
Optional[str]
|
the tag of the vVolume. Defaults to None. |
None
|
path |
Optional[str]
|
the path of the vVolume. Defaults to None. |
None
|
size |
int
|
the sime of the vVolume in MiB. Defaults to 100. |
100
|
retain |
bool
|
set true if the vVolume will be retained. Defaults to False. |
False
|
taint |
Optional[str]
|
the taint of the vVolume. Defaults to None. |
None
|
at |
Union[int, float, Callable]
|
same as entity. Defaults to simulation.now. |
now
|
after |
Optional[Entity | List[Entity]]
|
same as entity. Defaults to None. |
None
|
label |
Optional[str]
|
same as entity. Defaults to None. |
None
|
Source code in PyCloudSim\entity\v_volume.py
attach(container)
Attach the vVolume to a vContainer.
Source code in PyCloudSim\entity\v_volume.py
detach()
Detach the vVolume from a vContainer.