Commit 2ffa78db authored by Rene Hadler's avatar Rene Hadler

pve6-installer: Updates for LXC-Import

parent cb3dedd9
...@@ -243,8 +243,8 @@ class Installer(): ...@@ -243,8 +243,8 @@ class Installer():
"101": {"name": "Ubuntu Server StyrionLDAP", "template": True} "101": {"name": "Ubuntu Server StyrionLDAP", "template": True}
} }
self.LXC_IMPORTS = { self.LXC_IMPORTS = {
"500": {"name": "Samba Backupassist mit ADS Anbindung", "template": True, "search": "samba-backupassist_mit_ADS-Anbindung"}, "102": {"name": "Samba Backupassist mit ADS Anbindung", "template": True },
"501": {"name": "Samba Backupassist ohne ADS Anbindung", "template": True, "search": "samba-backupassist_ohne_ADS-Anbindung"}, "121": {"name": "Samba Backupassist ohne ADS Anbindung", "template": True },
} }
self.PUPPETS = { self.PUPPETS = {
"kein": "Nein", "kein": "Nein",
...@@ -584,7 +584,7 @@ class Installer(): ...@@ -584,7 +584,7 @@ class Installer():
if run_cmd('pvesh get /storage | grep -i local-lvm', argShell=True) == 0: if run_cmd('pvesh get /storage | grep -i local-lvm', argShell=True) == 0:
storage = "local-lvm" storage = "local-lvm"
if len(self.vm_import) > 0: if len(self.vm_import) > 0 or len(self.lxc_import) > 0:
retval = gui_password_box("Samba Passwort benötigt", "Bitte das Passwort für Share " + VM_TEMPLATE_CIFS_SHARE + " und Benutzer " + VM_TEMPLATE_CIFS_USER + " eingeben.") retval = gui_password_box("Samba Passwort benötigt", "Bitte das Passwort für Share " + VM_TEMPLATE_CIFS_SHARE + " und Benutzer " + VM_TEMPLATE_CIFS_USER + " eingeben.")
VM_TEMPLATE_CIFS_PASS = retval[1] VM_TEMPLATE_CIFS_PASS = retval[1]
...@@ -609,11 +609,11 @@ class Installer(): ...@@ -609,11 +609,11 @@ class Installer():
# Import selected LXCs # Import selected LXCs
for vm_id in self.lxc_import: for vm_id in self.lxc_import:
(ret, filename) = run_cmd_stdout("ls -t /mnt/template/cache/%s* | head -n1" % self.LXC_IMPORTS[vm_id]["search"], argShell=True) (ret, filename) = run_cmd_stdout("ls -t /mnt/dump/vzdump-lxc-%s-*.tar.* | head -n1" % vm_id, argShell=True)
if filename != "": if filename != "":
run_cmd("pct restore %s %s --storage %s" % (vm_id, filename.strip(), storage)) run_cmd("pct restore %s %s -storage %s" % (vm_id, filename.strip(), storage))
if self.VM_IMPORTS[vm_id]["template"] == True: if self.LXC_IMPORTS[vm_id]["template"] == True:
run_cmd("qm template %s" % vm_id) run_cmd("pct template %s" % vm_id)
run_cmd('umount /mnt') run_cmd('umount /mnt')
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment