Closed ganeshmaharaj closed 6 years ago
@ganeshmaharaj What we do on ciao is, by default, mount the host's GOPATH inside the VM. This is sort of what you want as it allows you to edit the source files on your host PC using your editor of choice, but compile and run the code in the VM. We could do the same thing here. We'd want to make the workload handle the case where the path was and wasn't mounted. So assuming the user wanted to share his host's devstack directory, he'd do
ccloudvm create devstack-xenial --mount devstack,passthrough,$HOME/devstack
Then in the workload we'd do something like
{{- if not (.MountPath "devstack")}}
- sudo -u {{.User}} {{template "ENV" .}} git clone http://git.openstack.org/openstack-dev/devstack /home/{{.User}}/devstack
{{- end}}
This way the clone only gets executed if the mount is not specified.
@ganeshmaharaj Do you know why the setup is so slow? If it's because it's downloading large files such as cloud images there might be something we can do here. Ccloudvm has a download function. If you use this function in your workloads the files are downloaded by ccloudvm itself and cached locally. So the next time you try to download the file, the file is download across the loopback network, and so is much quicker.
What happens is a series of git clones, install dependencies for each service, put files in place, adjust databases and migrate them in case there is a need, start each of the service as a systemd daemon. Not sure how much of that we can pre-empt prior to triggering the stack command. Also given this is how openstack does it, folks might prefer to stick to it. The one way to reduce the time is to reduce the number of services we install which would be easy if there is a way for us to get a local.conf from host into the guest if there is one available in a predefined location.
On Thu, Feb 15, 2018, 2:30 AM Mark Ryan notifications@github.com wrote:
@ganeshmaharaj https://github.com/ganeshmaharaj Do you know why the setup is so slow? If it's because it's downloading large files such as cloud images there might be something we can do here. Ccloudvm has a download function. If you use this function in your workloads the files are downloaded by ccloudvm itself and cached locally. So the next time you try to download the file, the file is download across the loopback network, and so is much quicker.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/intel/ccloudvm/pull/53#issuecomment-365886514, or mute the thread https://github.com/notifications/unsubscribe-auth/AFSZunlvdTrY2F4Y5iVrafla7R5pXW5Mks5tVAddgaJpZM4SF--0 .
@ganeshmaharaj In addition to the other changes we discussed we'll also need to add a body to the commit message.
@ganeshmaharaj Having problems testing this. I ran the script without any mounts.
The VM created correctly, but I had a number of issues. These are probably because I'm doing something wrong.
INFO keystone.cmd.cli [None req-ca4e2474-d938-4aed-9fa2-ef178e445c5f None None] Created public endpoint http://127.0.0.1/identity
Error on exit
@markdryan this enables devstack and pretty much everything that openstack has to offer. The complete stacking time it took on a 4core, 6GB machine was 37 mins. Also almost no developer uses the default local.conf. I am trying to see if we can look for a local.conf in the user's home dir and if exists, populate the local.conf we are pushing into the VM with it with the default as a fall-back. Was wondering if that is something that can be done with golang templates.