System VM
In CloudStack, there are two system VMs (Console Proxy VM and Secondary Storage VM) that are automatically created by CloudStack for each zone. Console Proxy VM (CPVM) provides console access to tenant's guest VMs, while Secondary Storage VM (SSVM) downloads and maintains VM templates used by tenants. While setting up CloudStack, you may experience problems with either of the system VMs. For example, SSVM cannot reach the Internet, or cannot download a default system template from http://download.cloud.com for some reason. In that case, it helps to diagnose the problem after logging in to SSVM.You can log in to a system VM via SSH from within the compute node that runs the VM as follows.
In the system VMs created by CloudStatck, sshd listens on the link-local address (in 169.254.0.0/16 subnet) only, and no other interface. Therefore, you first need to find out the link-local address assigned to a system VM in question. You can find the link-local address information of the system VM from "Infrastructure" menu of CloudStack's web-based management interface.
Then, ssh to the system VM on port number 3922 from within their underlying compute node as follows.
ssh -i /root/.ssh/id_rsa.cloud -p 3922 root@169.254.x.x
Use Local Storage
When CloudStack is deploying a VM (including guest VMs and system VMs), by default, the VM is set to use NFS-mounted primary storage as their root partition. The NFS-mounted primary storage is shared among all compute nodes located in the same CloudStack cluster. One of the reasons for using shared primary storage is VM migration. It is easy to migrate a VM from one compute node to another if the VM is backed by the same shared primary storage. If you don't need to migrate VMs, and compute nodes have plenty of local storage, you can configure CloudStack such that deployed VMs use compute node's local storage.In order to use local storage for CloudStack VMs, log in to CloudStack's management interface as admin, and do the following.
Go to "Global Settings", and change the following attributes to "true":
- system.vm.use.local.storage
- use.local.storage
$ sudo service cloud-management restartNext, you must create a new Compute Offering which uses local storage for VM storage. To do so, go to "Service Offerings" in CloudStack's management interface, and choose "Compute Offerings". Then add a new Compute Offering with "Storage type" set to "Local".
Now when you deploy a new VM, you need to choose the Compute Offering that you just created, in order to use local storage.
CloudStack环境如何推到重来
在研发基于CloudStack之上的应用时,经常遇到要重新安装CloudStack,如果全部重装的话,太慢,所以找到了一个简单办法,只需要删除存储SR并重新部署CloudStack数据库即可。- 止CloudStack服务。service cloud-management stop.
- 到mysql里查询select uuid from storage_pool; 使用http://blog.csdn.net/jkeven/article/details/8055523里的方法,删除存储的SR。
- 删除CloudStack数据库,drop database cloud; drop database cloud_usage;
- 重新部署CS数据库 cloud-setup-databases cloud:ctrix@localhost --deploy-as=root:ctrix
- 安装系统模版(不同的hypervisor请安装不同的系统模版) /usr/lib64/cloud/agent/scripts/storage/secondary/cloud-install-sys-tmplt -m /home/secondary -u http://download.cloud.com/templates/acton/acton-systemvm-02062012.vhd.bz2 -h xenserver -F
- service cloud-management start
- 再次访问,就会出现可爱的欢迎界面,世界清净了,重新开始吧。
CloudStack ISO Upload
"python -m SimpleHTTPServer 443"http://192.168.146.212:443
in cloudstack, since it is a local repo, i have to fill in the global settings: "secstorage.allowed.internal.sites" to value "192.168.146.0/24" (since this is my CIDR here)
-i now just have to go to the template tab, select "create template" or "create iso" according to my need
-as URL enter
http://192.168.146.212:443/myFile.qcow2
, fill in the other fields correctly and it should download
-if you need to restart the download of a template:
ssh into your SSVM, and enter "service cloud stop", then "service cloud start". This seems to work better thant "service cloud restart", that do not work every time on my machine (the service seems to try to restart before it is actually really stopped)
Advanced Network
http://vimeo.com/48484951
没有评论:
发表评论