apache-cloudstack

How can i use local storage as Primary and Secondary storage during Cloudstack UI?


I am trying to create a mobile Cloudstack 4.2 on 2 PCs. 1st pc = Xenserver 2nd pc = ACS 4.2

I am quite stuck in creating Primary storage during the Cloudstack UI as it prompt me "Something went wrong; You may go back and correct errors, Failed to add data store"

This is what I have do when trying to make my local storage as primary/secondary storage.

mkdir -p /export/primary /export/secondary

nano /etc/exports 

/export  *(rw,async,no_root_squash,no_subtree_check)

exportfs -a

mount -t nfs 172.16.109.4:/export/primary /export/primary
mount -t nfs 172.16.109.4:/export/secondary /export/secondary

usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /export/secondary -u http://d21ifhcun6b1t2.cloudfront.net/templates/4.2/systemvmtemplate-2013-07-12-master-xen.vhd.bz2 -h xenserver -F

Cloudstack-setup-management

I have successfully managed to enter the Cloudstack UI but fail at fail to add data store. Adding host was fine too.

I would like to ask if my step is correct? (Definitely wrong as I did not achieve my result)

and

Why it's wrong? How could I correct it?

Is it because I am stacking the folders?

Seeding the template goes into the NFS storage or it's mountpoint?

I have successfully deploy cloudstack with running VMS with a external NFS storage but it's too slow as my network is quite slow...


Solution

  • If you want to use local primary storage with XenServer you need at least two things:

    1. enable local storage in CS global settings (Global settings -> search for local -> set to true -> restart CS Management Server)
    2. make sure you have enough space allocated for the primary storage on the XenServer. Xen server uses LVM to create a primary storage volume. You can see the volume it's using by doing xe sr-list on you XenServer console (where sr stands for storage repository)

    See the script in [1] for guidance on how to setup your XenServer for CS. Or feel free to use the script and make pull requests whenever you find something that is not right.

    [1] - https://github.com/schubergphilis/cloudstack-utility-scripts/blob/master/devcloud/setup-xen-server.sh