Skip to content

Commit b42d11c

Browse files
committed
added support/example for diskConfig value
1 parent 3ea21e5 commit b42d11c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/OpenCloud/Compute/Server.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function Create($params = array())
135135

136136
$this->debug(Lang::translate('Server::Create() [%s]'), $this->name);
137137

138-
$create = $this->CreateJson();
138+
$create = $this->CreateJson($params);
139139

140140
$response = $this->Service()->Request(
141141
$this->Service()->Url(), 'POST', array(), $create);
@@ -528,14 +528,16 @@ public function Console($type='novnc') {
528528
* create {rebuild ...} by changing this parameter
529529
* @return json
530530
*/
531-
protected function CreateJson()
531+
protected function CreateJson(array $params=array())
532532
{
533533
// create a blank object
534534
$obj = new \stdClass();
535535

536536
// set a bunch of properties
537537
$obj->server = new \stdClass();
538538

539+
foreach ($params as $key => $ignore)
540+
$obj->server->$key = $this->$key;
539541
$obj->server->imageRef = $this->imageRef;
540542
$obj->server->name = $this->name;
541543
$obj->server->flavorRef = $this->flavorRef;

samples/compute/create.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
// create it
6868
print("Creating server...");
6969
$server->Create(array(
70+
'OS-DCF:diskConfig' => 'MANUAL',
7071
'image' => $myimage,
7172
'flavor' => $myflavor));
7273
print("requested, now waiting...\n");

0 commit comments

Comments
 (0)