From 50404f3b23b7fd6aeae4c9d2f6df0ea25e984e66 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 3 May 2016 19:03:09 +0200 Subject: WIP --- modules-available/vmstore/config.json | 4 + .../vmstore/lang/de/templates/mount.json | 5 + .../vmstore/lang/de/templates/page-vmstore.json | 17 ++++ modules-available/vmstore/lang/en/module.json | 21 ++++ .../vmstore/lang/en/templates/mount.json | 5 + .../vmstore/lang/en/templates/page-vmstore.json | 17 ++++ modules-available/vmstore/lang/pt/module.json | 21 ++++ modules-available/vmstore/page.inc.php | 63 ++++++++++++ modules-available/vmstore/templates/mount.html | 25 +++++ .../vmstore/templates/page-vmstore.html | 111 +++++++++++++++++++++ 10 files changed, 289 insertions(+) create mode 100644 modules-available/vmstore/config.json create mode 100644 modules-available/vmstore/lang/de/templates/mount.json create mode 100644 modules-available/vmstore/lang/de/templates/page-vmstore.json create mode 100644 modules-available/vmstore/lang/en/module.json create mode 100644 modules-available/vmstore/lang/en/templates/mount.json create mode 100644 modules-available/vmstore/lang/en/templates/page-vmstore.json create mode 100644 modules-available/vmstore/lang/pt/module.json create mode 100644 modules-available/vmstore/page.inc.php create mode 100644 modules-available/vmstore/templates/mount.html create mode 100644 modules-available/vmstore/templates/page-vmstore.html (limited to 'modules-available/vmstore') diff --git a/modules-available/vmstore/config.json b/modules-available/vmstore/config.json new file mode 100644 index 00000000..f2abe27c --- /dev/null +++ b/modules-available/vmstore/config.json @@ -0,0 +1,4 @@ +{ + "category":"main.settings", + "enabled":"true" +} diff --git a/modules-available/vmstore/lang/de/templates/mount.json b/modules-available/vmstore/lang/de/templates/mount.json new file mode 100644 index 00000000..dbc75281 --- /dev/null +++ b/modules-available/vmstore/lang/de/templates/mount.json @@ -0,0 +1,5 @@ +{ + "lang_back": "Zur\u00fcck", + "lang_configure": "Konfigurieren", + "lang_vmLocationConfiguration": "VM Speicherort wird konfiguriert" +} \ No newline at end of file diff --git a/modules-available/vmstore/lang/de/templates/page-vmstore.json b/modules-available/vmstore/lang/de/templates/page-vmstore.json new file mode 100644 index 00000000..bb2c0634 --- /dev/null +++ b/modules-available/vmstore/lang/de/templates/page-vmstore.json @@ -0,0 +1,17 @@ +{ + "lang_close": "Schlie\u00dfen", + "lang_intern": "Intern", + "lang_nfsHelp1": "Ben\u00f6tigt wird ein NFSv4\/3-Share, der f\u00fcr den Satelliten-Server schreibbar, und f\u00fcr die Arbeitsstationen lesbar ist. Beispielkonfiguration auf dem NFS-Server, wenn der Satelliten-Server die Adresse 1.2.3.4 hat:", + "lang_nfsHelp2": "Alternative Konfiguration mittels all_sqash. In diesem Fall muss das Verzeichnis auf dem Server dem Benutzer mit der uid 1234 geh\u00f6ren:", + "lang_noAdditionalInformation": "Keine weitere Konfiguration notwendig", + "lang_password": "Passwort", + "lang_readOnly": "Nur-Lese-Zugangsdaten", + "lang_readWrite": "Lese\/Schreib-Zugangsdaten", + "lang_save": "Speichern", + "lang_username": "Benutzerkennung", + "lang_vmLocation": "VM Speicherort", + "lang_vmLocationChoose": "Bitte w\u00e4hlen Sie, wo die Images der Virtuellen Maschinen gespeichert werden sollen.", + "lang_vmLocationHelp1": "F\u00fcr Testzwecke k\u00f6nnen die VMs direkt auf dem Satellitenserver gespeichert werden. Sofern Sie jedoch die ausgelieferte Satelliten-vmdk betreiben bedenken Sie bitte, dass Sie dann nur ca. 100GB Speicher zur Verf\u00fcgung haben.", + "lang_vmLocationHelp2": "Im Produktivbetrieb bietet es sich an, hierf\u00fcr einen performanten Netzwerkspeicher zu benutzen. Dieser Netzwerkspeicher kann per NFS oder CIFS\/SMB eingebunden werden. In jedem Fall muss sichergestellt werden, dass der Satellitenserver zum Hinzuf\u00fcgen neuer Virtueller Maschinen Schreibzugriff auf diesen Netzwerkspeicher hat. Bei der Nutzung von NFSv3 kann dies IP-Basiert eingerichtet werden, f\u00fcr die Nutzung von CIFS\/SMB k\u00f6nnen Sie Zugangsdaten angaben, die zum Schreiben berechtigen.", + "lang_vmLocationHelp3": "Die bwLehrpool-Clients brauchen lediglich Lesezugriff auf den Netzwerkspeicher (und sollten aus Sicherheitsgr\u00fcnden auch wirklich nur lesen k\u00f6nnen). Bei CIFS\/SMB erreichen Sie dies am einfachsten, indem Sie passwortlosen Gastzugriff mit Leserechten auf die Freigabe erlauben." +} \ No newline at end of file diff --git a/modules-available/vmstore/lang/en/module.json b/modules-available/vmstore/lang/en/module.json new file mode 100644 index 00000000..9d11656f --- /dev/null +++ b/modules-available/vmstore/lang/en/module.json @@ -0,0 +1,21 @@ +{ + "lang_back": "Back", + "lang_close": "Close", + "lang_configure": "Configure", + "lang_intern": "Intern", + "lang_nfsHelp1": "An NFSv3-Share is required. It should be readable by all the workstations, and writable for the satellite server. An example, assuming the satellite server has IP address 1.2.3.4:", + "lang_nfsHelp2": "Alternate configuration using all_squash. The exported directory should be owned (and be writable) by the user with uid 1234.", + "lang_noAdditionalInformation": "No additional cofiguration required", + "lang_password": "Password", + "lang_readOnly": "Read-only Access", + "lang_readWrite": "Read\/Write Access", + "lang_save": "Save", + "lang_username": "Username", + "lang_vmLocation": "VM Location", + "lang_vmLocationChoose": "Please choose where the images of virtual machines will be stored.", + "lang_vmLocationConfiguration": "VM Location is being configured", + "lang_vmLocationHelp1": "For test purposes, the VMs can be stored directly on the Satellite server. However, if you operate the delivered satellite vmdk please remember that you have only about 100GB of memory.", + "lang_vmLocationHelp2": "In productive operation, it makes sense for this to use a high-performance network storage. This network storage can be integrated via NFS or CIFS \/ SMB. In any case, it must be ensured that the satellite server has write access to this network storage to add a new Virtual Machine . When using NFSv3 this can be set up IP-based, for the use of CIFS \/ SMB, you can access data disclosures that would entitle them to write.", + "lang_vmLocationHelp3": "The bwLehrpool clients only need read access to the network storage (and for security reasons, really can only read). In CIFS \/ SMB You can do this most easily by allowing passwordless guest access with read access to the share.", + "module_name": "Virtual Machine" +} \ No newline at end of file diff --git a/modules-available/vmstore/lang/en/templates/mount.json b/modules-available/vmstore/lang/en/templates/mount.json new file mode 100644 index 00000000..29814430 --- /dev/null +++ b/modules-available/vmstore/lang/en/templates/mount.json @@ -0,0 +1,5 @@ +{ + "lang_back": "Back", + "lang_configure": "Configure", + "lang_vmLocationConfiguration": "VM location is configured" +} \ No newline at end of file diff --git a/modules-available/vmstore/lang/en/templates/page-vmstore.json b/modules-available/vmstore/lang/en/templates/page-vmstore.json new file mode 100644 index 00000000..23ddbbd3 --- /dev/null +++ b/modules-available/vmstore/lang/en/templates/page-vmstore.json @@ -0,0 +1,17 @@ +{ + "lang_close": "Close", + "lang_intern": "Intern", + "lang_nfsHelp1": "An NFSv4\/3-Share is required. It should be readable by all the workstations, and writable for the satellite server. An example, assuming the satellite server has IP address 1.2.3.4:", + "lang_nfsHelp2": "Alternate configuration using all_squash. The exported directory should be owned (and be writable) by the user with uid 1234.", + "lang_noAdditionalInformation": "No additional cofiguration required", + "lang_password": "Password", + "lang_readOnly": "Read-only Access", + "lang_readWrite": "Read\/Write Access", + "lang_save": "Save", + "lang_username": "Username", + "lang_vmLocation": "VM Location", + "lang_vmLocationChoose": "Please choose where the images of virtual machines will be stored.", + "lang_vmLocationHelp1": "For test purposes, the VMs can be stored directly on the Satellite server. However, if you operate the delivered satellite vmdk please remember that you have only about 100GB of memory.", + "lang_vmLocationHelp2": "In productive operation, it makes sense for this to use a high-performance network storage. This network storage can be integrated via NFS or CIFS \/ SMB. In any case, it must be ensured that the satellite server has write access to this network storage to add a new Virtual Machine . When using NFSv3 this can be set up IP-based, for the use of CIFS \/ SMB, you can access data disclosures that would entitle them to write.", + "lang_vmLocationHelp3": "The bwLehrpool clients only need read access to the network storage (and for security reasons, really can only read). In CIFS \/ SMB You can do this most easily by allowing passwordless guest access with read access to the share." +} \ No newline at end of file diff --git a/modules-available/vmstore/lang/pt/module.json b/modules-available/vmstore/lang/pt/module.json new file mode 100644 index 00000000..1aa7fdaf --- /dev/null +++ b/modules-available/vmstore/lang/pt/module.json @@ -0,0 +1,21 @@ +{ + "lang_back": "Voltar", + "lang_close": "Fechar", + "lang_configure": "configurar", + "lang_intern": "Iterna", + "lang_nfsHelp1": "\u00c9 necess\u00e1rio um NFSv3-Share. Ele deve poder ser lido por todas as esta\u00e7\u00f5es de trabalho, e poder ser escrito pelo server. Um exemplo, assumindo que o server possui endere\u00e7o ip 1.2.3.4:", + "lang_nfsHelp2": "Configura\u00e7\u00e3o alternativa usando all_squash. O usu\u00e1rio com uid 1234 deve possuir ( e poder escrever em ) o diret\u00f3rio exportado.", + "lang_noAdditionalInformation": "Nenhuma configura\u00e7\u00e3o adicional necess\u00e1ria", + "lang_password": "Senha", + "lang_readOnly": "Acesso Somente Leitura", + "lang_readWrite": "Acesso Leitura\/Escrita", + "lang_save": "Salvar", + "lang_username": "Nome de Usu\u00e1rio", + "lang_vmLocation": "Localiza\u00e7\u00e3o da VM", + "lang_vmLocationChoose": "Por favor, escolha aonde as imagens das m\u00e1quinas virtuais ser\u00e3o armazenadas.", + "lang_vmLocationConfiguration": "Localiza\u00e7\u00e3o da VM \u00e9 configurada", + "lang_vmLocationHelp1": "Para fins de teste, as VMs podem ser armazenados diretamente no servidor sat\u00e9lite. No entanto, se voc\u00ea operar o vmdk do sat\u00e9lite entregue por favor lembre-se que voc\u00ea tem apenas cerca de 100 GB de mem\u00f3ria.", + "lang_vmLocationHelp2": "Em opera\u00e7\u00e3o, faz sentido para este usar um armazenamento de rede de alto desempenho. Este armazenamento de rede pode ser integrado atrav\u00e9s de NFS ou CIFS \/ SMB. Em qualquer caso, deve-se assegurar de que o servidor de sat\u00e9lite tenha acesso de grava\u00e7\u00e3o para este armazenamento de rede para poder adicionar uma nova m\u00e1quina virtual. Ao utilizar NFSv3 este pode ser configurado com base em IP, para o uso de CIFS \/ SMB, voc\u00ea pode acessar as divulga\u00e7\u00f5es de dados que lhe permitiria escrever.", + "lang_vmLocationHelp3": "Os clientes bwLehrpool s\u00f3 precisam ter acesso de leitura ao armazenamento de rede (e por raz\u00f5es de seguran\u00e7a, realmente s\u00f3 pode ler). Em CIFS \/ SMB Voc\u00ea pode fazer isso mais facilmente, permitindo o acesso a visitantes sem senha com acesso de leitura.", + "module_name": "M\u00e1quina Virtual" +} \ No newline at end of file diff --git a/modules-available/vmstore/page.inc.php b/modules-available/vmstore/page.inc.php new file mode 100644 index 00000000..81f92ee3 --- /dev/null +++ b/modules-available/vmstore/page.inc.php @@ -0,0 +1,63 @@ +setStore(); + } + } + + protected function doRender() + { + $action = Request::post('action'); + if ($action === 'setstore' && !Taskmanager::isFailed($this->mountTask)) { + Render::addTemplate('mount', array( + 'task' => $this->mountTask['id'] + )); + return; + } + $vmstore = Property::getVmStoreConfig(); + if (isset($vmstore['storetype'])) { + $vmstore['pre-' . $vmstore['storetype']] = 'checked'; + } + Render::addTemplate('page-vmstore', $vmstore); + } + + private function setStore() + { + foreach (array('storetype', 'nfsaddr', 'cifsaddr', 'cifsuser', 'cifspasswd', 'cifsuserro', 'cifspasswdro') as $key) { + $vmstore[$key] = trim(Request::post($key, '')); + } + $storetype = $vmstore['storetype']; + if (!in_array($storetype, array('internal', 'nfs', 'cifs'))) { + Message::addError('value-invalid', 'type', $storetype); + Util::redirect('?do=VmStore'); + } + // Validate syntax of nfs/cifs + if ($storetype === 'nfs' && !preg_match('#^\S+:\S+$#is', $vmstore['nfsaddr'])) { + Message::addError('value-invalid', 'nfsaddr', $vmstore['nfsaddr']); + Util::redirect('?do=VmStore'); + } + $vmstore['cifsaddr'] = str_replace('\\', '/', $vmstore['cifsaddr']); + if ($storetype === 'cifs' && !preg_match('#^//\S+/.+$#is', $vmstore['cifsaddr'])) { + Message::addError('value-invalid', 'nfsaddr', $vmstore['nfsaddr']); + Util::redirect('?do=VmStore'); + } + $this->mountTask = Trigger::mount($vmstore); + TaskmanagerCallback::addCallback($this->mountTask, 'manualMount', $vmstore); + } + +} \ No newline at end of file diff --git a/modules-available/vmstore/templates/mount.html b/modules-available/vmstore/templates/mount.html new file mode 100644 index 00000000..eabee81a --- /dev/null +++ b/modules-available/vmstore/templates/mount.html @@ -0,0 +1,25 @@ +
+
+ {{lang_vmLocationConfiguration}} +
+ +
+
{{lang_configure}}
+ +
+ + + +
+
\ No newline at end of file diff --git a/modules-available/vmstore/templates/page-vmstore.html b/modules-available/vmstore/templates/page-vmstore.html new file mode 100644 index 00000000..fe2c5225 --- /dev/null +++ b/modules-available/vmstore/templates/page-vmstore.html @@ -0,0 +1,111 @@ +
+ + + + +
+
+ {{lang_vmLocation}} +
+
+

{{lang_vmLocationChoose}}

+
+
+ {{lang_intern}} +
+
+ {{lang_noAdditionalInformation}} +
+
+
+
+ NFS + +
+
+ + +
+
+
+
+ CIFS +
+
+ + +
+ +
+ + {{lang_username}} + + + + {{lang_password}} + + +
+
+ +
+ + {{lang_username}} + + + + {{lang_password}} + + +
+
+
+ +
+
+
+ + + + -- cgit v1.2.3-55-g7522