Project

Profile

Help

Virtualization quickstart » History » Sprint/Milestone 7

Ichimonji10, 07/27/2017 04:41 PM
Fix various inline code and block code mis-usages.

1 1 kdelee@redhat.com
# Virtualization quickstart
2
3 4 kdelee@redhat.com
## Option 1: Using libvirt and Virtual Machine Manager on a Fedora 25 machine:
4 2 kdelee@redhat.com
5 1 kdelee@redhat.com
Install the following packages:
6
7 7 Ichimonji10
~~~
8
$ sudo dnf install libvirt qemu-kvm kvm libguestfs-tools virt-install
9
~~~
10 1 kdelee@redhat.com
11 7 Ichimonji10
Then, download an image for the OS you want to run in your VM. Here is a link to download an .iso for Fedora 26: https://getfedora.org/en/workstation/download/
12 1 kdelee@redhat.com
13
To launch "Virtual Machine Manager" press Super key and search "Virtual Machine Manager"
14
15
1\) File -\> New Virtual Machine  
16
2\) Local install media  
17
\* use file browser to find your downloaded image  
18
3\) accept default settings
19
20 2 kdelee@redhat.com
### SETTING UP THE VM:
21 1 kdelee@redhat.com
22 2 kdelee@redhat.com
  - Start the VM with the "play button"
23
  - Choose to install fedora:
24
  - set hostname: give it a name other than localhost.
25
  - make it meaningful
26
  - set root password (weak one is OK)
27 1 kdelee@redhat.com
  - if you make a user, make sure to give them sudo access
28
29
> NOTE:  
30
> If you forgot to make "admin" have sudo access:  
31 5 kdelee@redhat.com
> Once VM is running, go to terminal and switch to root
32
33 7 Ichimonji10
~~~
34
$ sudo gpasswd --add admin wheel
35
~~~
36 2 kdelee@redhat.com
37 5 kdelee@redhat.com
Then restart.
38
39 1 kdelee@redhat.com
> WARNING:
40 5 kdelee@redhat.com
41 1 kdelee@redhat.com
\`localhost\` is a BAD hostname. Each of your VMs should have a unique hostname. If \> you have cloned this VM from another, it will have the same hostname. This needs to change  
42
It is imperative that you change your hostname before installing any pulp components, as they use the hostname and can produce undefined behavior if the hostname is changed after the fact.
43
44 7 Ichimonji10
See your current hostname with: `hostname`.
45 1 kdelee@redhat.com
46 7 Ichimonji10
To change your hostname, run:
47 1 kdelee@redhat.com
48 7 Ichimonji10
~~~
49
$ sudo hostnamectl set-hostname DESIRED_NAME
50
~~~
51 5 kdelee@redhat.com
52 1 kdelee@redhat.com
### SETTING UP ANSIBLE (on the VM):
53
54
Install the ansible package:
55
56 7 Ichimonji10
~~~
57
$ sudo dnf install ansible git
58
~~~
59 1 kdelee@redhat.com
60
Ansible info:  
61 2 kdelee@redhat.com
For documentation see http://docs.ansible.com/
62 1 kdelee@redhat.com
63
Download the pulp_packaging repo:
64
65 7 Ichimonji10
~~~
66
$ git clone https://github.com/pulp/pulp_packaging.git
67
~~~
68 1 kdelee@redhat.com
69
Now we need to make a `hosts` file for ansible. Use the results of the `hostname` command in the place of 'localhost':
70
71
~~~
72 6 elyezer
$ cd pulp_packaging/ci/ansible
73 7 Ichimonji10
$ echo "$(hostname)" > hosts
74 6 elyezer
~~~
75
76
### Choosing what version of pulp to install
77 1 kdelee@redhat.com
78 2 kdelee@redhat.com
To choose the version of pulp that you will install, edit the file:  
79
`pulp_packaging/ci/ansible/roles/pulp/defaults/main.yaml`
80 1 kdelee@redhat.com
81 2 kdelee@redhat.com
OR pass `-e pulp_version=2.14 -e pulp_build=nightly` in the ansible-playbook invocation.
82
83
OR in hosts file, specify pulp_version and pulp_build on the same line as hostname, i.e.  
84 7 Ichimonji10
`name_of_host pulp_version=2.14 pulp_build=nightly`
85 1 kdelee@redhat.com
86 7 Ichimonji10
Now you are ready to run the ansible playbook:
87
88
~~~
89
$ sudo ansible-playbook -i hosts -e ansible_connection=local pulp_server.yaml
90
~~~
91 4 kdelee@redhat.com
92
## Option 2: Using Vagrant with either libvirt or docker
93
94 1 kdelee@redhat.com
See [Pulp Developer Setup](http://docs.pulpproject.org/dev-guide/contributing/dev_setup.html)