Openstack instance snapshot is creates an empty image - openstack

I have a local devstack deployment of openstack kilo, I wanted to backup a running instance in openstack. So I wanted to create snapshot of a running instance. I did create snapshot of running instances (both with API and Horizon); however, it is creates an empty image of file size. I tried to locate log files at /var/log/cinder but there is no such directory. Also, I was not able to find such log files at other locations in root tree. So where should I find the log files (for errors etc.) ?

Create snapshot of instance which is boot from volume, will create an empty image in glance and create snapshots of the volumes attached to instance.

Related

How to make Azure batch see my data files?

I am new to Azure batch. I am trying to use R in parallel with Azure batch in rstudio to run code on a cluster. I am able to successfully start the cluster and get the example code to work properly. When I try to run my own code I am getting an error that says the cluster nodes cannot find my data files. Do I have to change my working directory to Azure batch somehow?
Any information on how to do this is much appreciated.
I have figured out how to get Azure batch to see my data files. Not sure if this is the most efficient way, but here is what I did.
Download a program called Microsoft Azure Storage Explorer which runs on my local computer.
Connect to my Azure storage using the storage name and primary storage key found in the Azure portal.
in Microsoft Azure Storage Explorer find Blob containers, right click create new container.
Upload data files to that new container.
Right click on data files and go to copy URL.
Paste URL in R like this model_Data<-read.csv(paste('https://<STORAGE NAME HERE>.blob.core.windows.net/$root/k',k,'%20data%20file.csv',sep=''),header=T)

openstack : how to build a custom image from a VM

I have a Virtual machine that I have customized with all the packages I need and it runs using virt-manager. I logged in and created a few directories and scripts in that image. I would like to "snapshot" it and run the snapshot on openstack. I don't care if the runtime state is preserved. All I want is for the packages and custom code that I have created on the virtual machine to be there.
I tried various things with the qcow2 image that virt-manager uses but that did not work. I don't quite understand - where are the changes I made to the file system?
I would like to generate an image with my customizations that I can subsequently run on an openstack cloud.
How can I proceed?
Thanks
Ranga

Accessing files from Google cloud storage in RStudio

I have been trying to create connection between the Google cloud storage and RStudio server(The one I spinned up in Google cloud), so that I can access the files in R to run sum analysis on.
I have found three different ways to do it on the web, but I don't see many clarity around these ways so far.
Access the file by using the public URL specific to the file [This is not an option for me]
Mount the Google cloud storage as a disc in RStudio server and access it like any other files in the server [ I saw someone post about this method but could not find on any guides or materials that shows how it's done]
Using the googleCloudStorageR package to get full access to the Cloud Storage bucket.
The step 3 looks like the pretty standard way to do it. But I get following error when I try to hit the gcs_auth() command
Error in gar_auto_auth(required_scopes, new_user = new_user, no_auto =
no_auto, : Cannot authenticate -
options(googleAuthR.scopes.selected) needs to be set to
includehttps://www.googleapis.com/auth/devstorage.full_control or
https://www.googleapis.com/auth/devstorage.read_write or
https://www.googleapis.com/auth/cloud-platform
The guide on how to connect using this is found on
https://github.com/cloudyr/googleCloudStorageR
but it says it requires a service-auth.json file to set the environment variables and all other keys and secret keys, but do not really specify on what these really are.
If someone could help me know how this is actually setup, or point me to a nice guide on setting the environment up, I would be very much grateful.
Thank you.
Before using any services by google cloud you have to attach your card.
So, I am assuming that you have created the account, after creating the account go to Console ,if you have not created Project then Create Project, then click on sidebar find APIs & Services > Credentials.
Then,
1)Create Service Account Keys save this File in json you can only download it once.
2)OAuth 2.0 client ID give the name of the app and select type as web application and download the json file.
Now For Storage go to Sidebar Find Storage and click on it.
Create Bucket and give the name of Bucket.
I have added the single image in bucket, you can also add for the code purpose.
lets look how to download this image from storage for other things you can follow the link that you have given.
First create environment file as .Renviron so it automatically catches the json file and save it in a working directory.
In .Renviron file add those two downloaded json files like this
GCS_AUTH_FILE="serviceaccount.json"
GAR_CLIENT_WEB_JSON="Oauthclient.json"
#R part
library(googleCloudStorageR)
library(googleAuthR)
gcs_auth() # for authentication
#set the scope
gar_set_client(scopes = c("https://www.googleapis.com/auth/devstorage.read_write",
"https://www.googleapis.com/auth/cloud-platform"))
gcs_get_bucket("you_bucket_name") #name of the bucket that you have created
gcs_global_bucket("you_bucket_name") #set it as global bucket
gcs_get_global_bucket() #check if your bucket is set as global,you should get your bucket name
objects <- gcs_list_objects() # data from the bucket as list
names(objects)
gcs_get_object(objects$name[[1]], saveToDisk = "abc.jpeg") #save the data
**Note :**if you dont get json file loaded restart the session using .rs.restartR()
and check the using
Sys.getenv("GCS_AUTH_FILE")
Sys.getenv("GAR_CLIENT_WEB_JSON")
#it should show the files
You probably want the FUSE adaptor - this will allow you to mount your GCS bucket as a directory on your Server.
Install gcsfuse on the R server.
create a mnt directory.
run gcsfuse your-bucket /path/to/mnt
Be aware though that RW performance isnt great vis FUSE
Full documentation
https://cloud.google.com/storage/docs/gcs-fuse

How to copy files to each user's space in docker

I am writing a docker file to conduct an evaluation of an R package that I have written. The package is installed inside RStudio server. My docker file inherits from FROM rocker/rstudio. I want the docker file to install the everything (which it does) and create 20 users (user1, user2, ..., user20) as test subjects. Each test subject additionally should have a data folder (/home/data) to contain some CSV files.
Later when the container is run, The RStudio's web interface allows the test subjects to login using the user credentials just created. They have access to their own data, perform the tests, and generates some new files in their home directory.
I am able to create the users using RUN useradd -ms /bin/bash user1 and set the current user to users USER user1, but do not know how to transfer the files alongside the Dockerfile.
Note 1: I do not like the dea of putting the files on the host machine and sharing them with the docker users. Instead I want to have them shipped with the Dockerfile and get them added to the image and container when the Dockerfile is built and run.
Note 2: I need to do the evaluation is a reproducible way, because I need to repeat it several times.
You can use the COPY or ADD command in the dockerfile to get files in to you docker machine. Have a look here for more information.

Not able to create instances on CloudStack

I have created a Zone, Pod and Cluster on CloudStack.I have also added a host in the Cluster, added Primary Storage and Secondary Storage. But in System VMs, nothing is listed. Also, in the logs a message "No running ssvm is found, so command will be sent to LocalHostEndPoint" comes.
Somehow I deduced that due to this, template is not being added and consequently Instances can't be created as Instances use templates to add OS in VMs.
Can anybody please help to point out and sort the problem which may be the cause here.
You need to manually install the "system VM" templates. These are the images for worker VMs that CloudStack deploys to run system services. SSVM is an example of a SystemVM. It is responsible for copying templates to secondary storage.
See Prepare the System VM Template in the installation guide.

Resources