Project

Profile

Help

Virtualization quickstart » History » Sprint/Milestone 4

kdelee@redhat.com, 07/26/2017 05:10 PM

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
`$ sudo dnf install libvirt qemu-kvm kvm libguestfs-tools virt-install`
8
9
Then, download an image for the OS you want to run in your VM.  
10
Here is a link to download an .iso for Fedora 26:  
11
https://getfedora.org/en/workstation/download/
12
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
\==================================================
21
22 2 kdelee@redhat.com
### SETTING UP THE VM:
23 1 kdelee@redhat.com
24 2 kdelee@redhat.com
  - Start the VM with the "play button"
25
  - Choose to install fedora:
26
  - set hostname: give it a name other than localhost.
27
  - make it meaningful
28
  - set root password (weak one is OK)
29
  - if you make a user, make sure to give them sudo access
30
31 1 kdelee@redhat.com
\---------------------------  
32
NOTE:  
33
If you forgot to make "admin" have sudo access:  
34
Once VM is running, go to terminal and switch to root
35
36
`[root@VM0 admin]# gpasswd --add admin wheel`
37
38 2 kdelee@redhat.com
Then restart.
39 1 kdelee@redhat.com
40
\--------------------------  
41
\--------------------------  
42
WARNING:  
43
\`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  
44
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.
45
46
See your current hostname with:  
47
<code>  
48
$ echo $HOSTNAME
49
50
To change your hostname, run
51
52
$ sudo hostnamectl set-hostname DESIRED_NAME  
53
</code>  
54
\----------------------------
55
56
\==========================================================  
57 2 kdelee@redhat.com
h3. SETTING UP ANSIBLE (on the VM):
58 1 kdelee@redhat.com
59
Install the ansible package:
60
61
`$ sudo dnf install ansible git`
62
63
Ansible info:  
64 2 kdelee@redhat.com
For documentation see http://docs.ansible.com/
65 1 kdelee@redhat.com
66
Download the pulp_packaging repo:
67
68
`$ git clone https://github.com/pulp/pulp_packaging.git`
69
70 3 kdelee@redhat.com
Now we need to make a `hosts` file for ansible. Use the results of the `hostname` command in the place of 'localhost':  
71 1 kdelee@redhat.com
<code>  
72
$ cd pulp_packaging/ci/ansible  
73
$ cat \> hosts \<<EOF
74
> $(hostname)  
75
\> EOF  
76
</code>
77
78 2 kdelee@redhat.com
### Choosing what version of pulp to install
79
80 1 kdelee@redhat.com
To choose the version of pulp that you will install, edit the file:  
81 2 kdelee@redhat.com
`pulp_packaging/ci/ansible/roles/pulp/defaults/main.yaml`
82
83
OR pass `-e pulp_version=2.14 -e pulp_build=nightly` in the ansible-playbook invocation.
84
85 1 kdelee@redhat.com
OR in hosts file, specify pulp_version and pulp_build on the same line as hostname, i.e.  
86
`Nameofhost pulp_version=2.14 pulp_build=nightly`
87
88
Now you are ready to run the ansible playbook:  
89
`$ sudo ansible-playbook -i hosts -e ansible_connection=local pulp_server.yaml`
90 4 kdelee@redhat.com
91
## Option 2: Using Vagrant with either libvirt or docker
92
93
See [Pulp Developer Setup](http://docs.pulpproject.org/dev-guide/contributing/dev_setup.html)