Project

Profile

Help

Virtualization quickstart » History » Sprint/Milestone 12

pthomas@redhat.com, 07/27/2017 09:39 PM

1 1 kdelee@redhat.com
# Virtualization quickstart
2
3 8 Ichimonji10
This quickstart guide has been tested on Fedora 25.
4 2 kdelee@redhat.com
5 8 Ichimonji10
Within code blocks, a prefix of `$` indicates that a command should be executed as a regular user, and `#` indicates that a command should be performed as root.
6 1 kdelee@redhat.com
7 8 Ichimonji10
## Option 1: Using libvirt and Virtual Machine Manager
8
9
Install required packages:
10
11 1 kdelee@redhat.com
~~~
12 8 Ichimonji10
# dnf install libvirt qemu-kvm kvm libguestfs-tools virt-install
13 1 kdelee@redhat.com
~~~
14
15 8 Ichimonji10
Then, download an image for the OS you want to run in your VM. Fedora ISOs may be downloaded [from here](https://getfedora.org/en/workstation/download/).
16 1 kdelee@redhat.com
17 8 Ichimonji10
Launch the "Virtual Machine Manager" application and click:
18 1 kdelee@redhat.com
19 10 Ichimonji10
1\. File → New Virtual Machine  
20
2\. Local install media → Browse to downloaded ISO  
21 8 Ichimonji10
3\) Accept default settings
22 1 kdelee@redhat.com
23
### SETTING UP THE VM:
24
25 8 Ichimonji10
1\. Start the VM with the "play button"  
26
2\. Choose to install fedora:  
27
3\. set hostname: give it a name other than localhost.  
28
4\. make it meaningful  
29
5\. set root password (weak one is OK)  
30
6\. if you make a user, make sure to give them sudo access
31 5 kdelee@redhat.com
32 8 Ichimonji10
**NOTE**: If you make a user and forgot to give them sudo access, start the VM, open a terminal, and:
33 5 kdelee@redhat.com
34 1 kdelee@redhat.com
~~~
35 8 Ichimonji10
$ su
36
# gpasswd --add admin wheel
37 1 kdelee@redhat.com
~~~
38 7 Ichimonji10
39 1 kdelee@redhat.com
Then restart.
40
41 8 Ichimonji10
**WARNING**: `localhost` is a **bad** hostname. Each of your VMs should have a unique hostname. If you clone a VM, both hosts will have the same hostname. It is imperative that you change your a host's hostname before installing any pulp components, as Pulp uses its host's hostname, and Pulp can produce undefined behavior if its host's hostname is changed after the fact.
42 7 Ichimonji10
43 8 Ichimonji10
To see your host's hostname, execute `hostname`. To change your host's hostname, run:
44 5 kdelee@redhat.com
45 1 kdelee@redhat.com
~~~
46 8 Ichimonji10
# hostnamectl set-hostname <new-hostname>
47 1 kdelee@redhat.com
~~~
48
49
### SETTING UP ANSIBLE (on the VM):
50 7 Ichimonji10
51 9 Ichimonji10
For details on Ansible, see the [Ansible documentation](https://docs.ansible.com/).
52
53 8 Ichimonji10
Install Ansible:
54 1 kdelee@redhat.com
55
~~~
56 7 Ichimonji10
# dnf install ansible git
57
~~~
58 1 kdelee@redhat.com
59
Download the pulp_packaging repo:
60
61
~~~
62 6 elyezer
$ git clone https://github.com/pulp/pulp_packaging.git
63 7 Ichimonji10
~~~
64 6 elyezer
65 8 Ichimonji10
Now we need to make a `hosts` file for Ansible. Use the results of the `hostname` command in the place of 'localhost':
66 6 elyezer
67 1 kdelee@redhat.com
~~~
68 2 kdelee@redhat.com
$ cd pulp_packaging/ci/ansible
69
$ echo "$(hostname)" > hosts
70 1 kdelee@redhat.com
~~~
71 2 kdelee@redhat.com
72
### Choosing what version of pulp to install
73
74 8 Ichimonji10
To choose the version of pulp that you will install:
75 1 kdelee@redhat.com
76 8 Ichimonji10
  - edit `pulp_packaging/ci/ansible/roles/pulp/defaults/main.yaml`, or
77 12 pthomas@redhat.com
  - pass `-e pulp_version=2.14 -e pulp_build=beta` in the `ansible-playbook` invocation, or
78
  - in hosts file, specify pulp_version and pulp_build on the same line as hostname, i.e. `name_of_host pulp_version=2.14 pulp_build=beta`
79 7 Ichimonji10
80
Now you are ready to run the ansible playbook:
81 4 kdelee@redhat.com
82
~~~
83 8 Ichimonji10
$ ansible-playbook -i hosts -e ansible_connection=local pulp_server.yaml
84 1 kdelee@redhat.com
~~~
85
86
## Option 2: Using Vagrant with either libvirt or docker
87
88
See [Pulp Developer Setup](http://docs.pulpproject.org/dev-guide/contributing/dev_setup.html)