Skip to content

Commit

Permalink
Ssh driver
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudOver committed Oct 5, 2016
1 parent c1c6c98 commit 9edb982
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/templates/devices/base_image.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</source>
<target dev='sda' bus='{{ vm.base_image.disk_controller }}'/>
</disk>
{% elif %}
{% elif vm.base_image.storage.transport == "ssh" %}
<disk type='volume' device='disk'>
<driver name='qemu' type='{{ vm.base_image.format }}' cache="writeback" io="threads" />
<source file='/images/{{ vm.id }}'/>
Expand Down
4 changes: 2 additions & 2 deletions corecluster/agents/image_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def task_failed(self, task, exception):

def create(self, task):
image = task.get_obj('Image')
system.call(['qemu-img', 'create', '-f', image.format, image.storage.path + '/' + image.libvirt_name, image.size])
system.call(['qemu-img', 'create', '-f', image.format, image.storage.path + '/' + image.libvirt_name, str(image.size)])
image.size = os.stat(image.storage.path + '/' + image.libvirt_name).st_size
image.set_state('ok')
image.save()
Expand Down Expand Up @@ -89,7 +89,7 @@ def upload_url(self, task):
image.save()

remote.close()
f.close()
volume.close()

log(msg="Rebasing image to no backend", tags=('agent', 'image', 'info'), context=task.logger_ctx)
if image.format in ['qcow2', 'qed']:
Expand Down
10 changes: 7 additions & 3 deletions corecluster/agents/storage_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ def task_failed(self, task, exception):


def mount(self, task):
pass
storage = task.get_obj('Storage')
storage.state = 'ok'
storage.save()


def umount(self, operation):
pass
def umount(self, task):
storage = task.get_obj('Storage')
storage.state = 'locked'
storage.save()
5 changes: 4 additions & 1 deletion corecluster/models/core/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ def path(self):
conn.storagePoolLookupByName(self.name)
except:
raise CoreException('storage_not_mounted')
return '/var/lib/cc1/storages/%s/' % self.name
if self.transport == 'ssh':
return self.dir
else:
return '/var/lib/cloudOver/storages/%s/' % self.name


@property
Expand Down
2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
corecluster (16.10.02) stable; urgency=low
corecluster (16.10.03) stable; urgency=low

* Fixed image_create for large sizes

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def version():
setup(
name = 'corecluster',
packages = find_packages(exclude=['config', 'config.*']),
version = '16.09.20',
version = '16.10.03',
description = 'CloudOver core IaaS system',
author = 'Marta Nabozny',
author_email = 'martastrzet@gmail.com',
Expand Down

0 comments on commit 9edb982

Please sign in to comment.